summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-02-21 20:10:32 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-02-21 20:10:32 +0000
commit52489ddf33e07d5ee2c3e0be645848425c535550 (patch)
tree1bc98f1aa680074d5d9d8743ad40dcd2f4e4b3ea /gnu/usr.bin
parent27804e0518d7c4593b1e1d6adfcab4922dd616f4 (diff)
Backport a small fragment of a gcc 3.4 fix preventing too much recursion in
simplify_shift_const(), and only do this on mips64 platforms, because we are too late in the release cycle. This change has the nice side effect of preventing a wrong overoptimistic optimization on mips64, when masking bit 31 of a long; which in turns causes python to misbehave. Help and ok otto@
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/gcc/gcc/combine.c21
-rw-r--r--gnu/usr.bin/gcc/gcc/config/mips/openbsd.h3
2 files changed, 14 insertions, 10 deletions
diff --git a/gnu/usr.bin/gcc/gcc/combine.c b/gnu/usr.bin/gcc/gcc/combine.c
index 3d113915f65..29142b7d2fc 100644
--- a/gnu/usr.bin/gcc/gcc/combine.c
+++ b/gnu/usr.bin/gcc/gcc/combine.c
@@ -9737,17 +9737,20 @@ simplify_shift_const (x, code, result_mode, varop, orig_count)
/* If we can't do that, try to simplify the shift in each arm of the
logical expression, make a new logical expression, and apply
the inverse distributive law. */
- {
- rtx lhs = simplify_shift_const (NULL_RTX, code, shift_mode,
- XEXP (varop, 0), count);
- rtx rhs = simplify_shift_const (NULL_RTX, code, shift_mode,
- XEXP (varop, 1), count);
+#ifdef BROKEN_SIMPLIFY_SHIFT_CONST_P
+ if (GET_CODE (XEXP (varop, 1)) == CONST_INT)
+#endif
+ {
+ rtx lhs = simplify_shift_const (NULL_RTX, code, shift_mode,
+ XEXP (varop, 0), count);
+ rtx rhs = simplify_shift_const (NULL_RTX, code, shift_mode,
+ XEXP (varop, 1), count);
- varop = gen_binary (GET_CODE (varop), shift_mode, lhs, rhs);
- varop = apply_distributive_law (varop);
+ varop = gen_binary (GET_CODE (varop), shift_mode, lhs, rhs);
+ varop = apply_distributive_law (varop);
- count = 0;
- }
+ count = 0;
+ }
break;
case EQ:
diff --git a/gnu/usr.bin/gcc/gcc/config/mips/openbsd.h b/gnu/usr.bin/gcc/gcc/config/mips/openbsd.h
index 36fa6c6402b..cdb3c003f76 100644
--- a/gnu/usr.bin/gcc/gcc/config/mips/openbsd.h
+++ b/gnu/usr.bin/gcc/gcc/config/mips/openbsd.h
@@ -136,4 +136,5 @@ Boston, MA 02111-1307, USA. */
#undef MIPS_DEFAULT_GVALUE
#define MIPS_DEFAULT_GVALUE 0
-
+/* Prevent too much recursion in simplify_shift_const(). */
+#define BROKEN_SIMPLIFY_SHIFT_CONST_P