* cse.c (fold_rtx): Work around bug in Sun V5.0 compilers.
authorJeffrey A Law <law@cygnus.com>
Sat, 28 Aug 1999 05:41:44 +0000 (05:41 +0000)
committerJeff Law <law@gcc.gnu.org>
Sat, 28 Aug 1999 05:41:44 +0000 (23:41 -0600)
From-SVN: r28941

gcc/ChangeLog
gcc/cse.c

index f123ab187d2954e77eebbf5a0c63236e9a0a7590..283fce6796e43e3e3100ecf8811e228f99e30c76 100644 (file)
@@ -1,5 +1,7 @@
 Fri Aug 27 15:35:24 1999  Jeffrey A Law  (law@cygnus.com)
 
+       * cse.c (fold_rtx): Work around bug in Sun V5.0 compilers.
+
        * pa.c (emit_move_sequence): Do not stop on SUBREG_WORD of an
        operand.
 
index c39ab9f8522c3afdb86c05135e8434f51d2a2f6f..7a13a7b2d249fee9e8f47aaa6fad21bfe51b8d13 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5802,7 +5802,14 @@ fold_rtx (x, insn)
             hence not save anything) or be incorrect.  */
          if (const_arg1 != 0 && GET_CODE (const_arg1) == CONST_INT
              && INTVAL (const_arg1) < 0
-             && - INTVAL (const_arg1) >= 0
+             /* This used to test
+
+                - INTVAL (const_arg1) >= 0
+
+                But The Sun V5.0 compilers mis-compiled that test.  So
+                instead we test for the problematic value in a more direct
+                manner and hope the Sun compilers get it correct.  */
+             && INTVAL (const_arg1) != (1 << (HOST_BITS_PER_WIDE_INT - 1))
              && GET_CODE (folded_arg1) == REG)
            {
              rtx new_const = GEN_INT (- INTVAL (const_arg1));