diff --git a/gcc/gcc/config/haiku.h b/gcc/gcc/config/haiku.h index 37adf4081d..88adc25772 100644 --- a/gcc/gcc/config/haiku.h +++ b/gcc/gcc/config/haiku.h @@ -44,11 +44,17 @@ Boston, MA 02111-1307, USA. */ /* Haiku uses lots of multichars, so don't warn about them unless the user explicitly asks for the warnings with -Wmultichar. Note that - CC1_SPEC is used for both cc1 and cc1plus. */ -#undef CC1_SPEC -#define CC1_SPEC \ + CC1_SPEC is used for both cc1 and cc1plus. + + HAIKU_CC1_SPEC is common options for all architectures. The frame pointer is also enabled + for all architectures, except for 32-bit i386, because that one has a very limited number of + registers, and the performance impact is too high. */ +#define HAIKU_CC1_SPEC \ "%{fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE:;:-fPIC} \ %{!Wmultichar: -Wno-multichar} %(cc1_cpu) %{profile:-p}" +#undef CC1_SPEC +#define CC1_SPEC \ + HAIKU_CC1_SPEC " %{!fomit-frame-pointer: -fno-omit-frame-pointer}" #undef CC1PLUS_SPEC #define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}" diff --git a/gcc/gcc/config/i386/haiku.h b/gcc/gcc/config/i386/haiku.h index 3379e19f54..4d43c6bbfa 100644 --- a/gcc/gcc/config/i386/haiku.h +++ b/gcc/gcc/config/i386/haiku.h @@ -75,3 +75,8 @@ Boston, MA 02111-1307, USA. */ if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)) #endif + +/* On 32-bit i386, because there are so few registers, keep the frame pointer disabled by default. + * Other architectures have it always enabled for Haiku */ +#undef CC1_SPEC +#define CC1_SPEC HAIKU_CC1_SPEC