summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-03-28 20:57:42 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-03-28 20:57:42 +0000
commit5de57f8022aab8888c984a51f12ece6ee30e3693 (patch)
tree69435bfe0364a910f6858b4ac5637a7fd2c5f661 /gnu
parentab074ef58a1ef1c8853a660526e19ca4ef20115a (diff)
Default to -mfix-r4000 -mfix-r4400 when building in big endian mode. This is
a lifesaver for R4000 and R4400 operation; without these, every int->long promotion occuring shortly after an integer multiplication (such as an array element access when the array item size is not a power of two) loses horribly, and panic^Whilarity ensues. This mostly causes assembly insns to be shuffled, but almost no code size growth and no noticeable performance hit on processors which do not need these insn placement workarounds.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/gcc/gcc/config/mips/openbsd.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gnu/gcc/gcc/config/mips/openbsd.h b/gnu/gcc/gcc/config/mips/openbsd.h
index e8fe656a01e..c62789e84d9 100644
--- a/gnu/gcc/gcc/config/mips/openbsd.h
+++ b/gnu/gcc/gcc/config/mips/openbsd.h
@@ -205,3 +205,14 @@ Boston, MA 02110-1301, USA. */
#define LIB_SPEC OBSD_LIB_SPEC
#undef ENABLE_EXECUTE_STACK
+
+/* Default to -mfix-r4000 -mfix-r4400 when compiling big endian. */
+#undef OVERRIDE_OPTIONS
+#define OVERRIDE_OPTIONS \
+ do { \
+ if (TARGET_BIG_ENDIAN) \
+ { \
+ target_flags |= MASK_FIX_R4000 | MASK_FIX_R4400; \
+ } \
+ override_options (); \
+ } while (0)