simplify-rtx.c (simplify_binary_operation_1): Check for CONST...
authorRichard Sandiford <rdsandiford@googlemail.com>
Tue, 2 Sep 2008 18:39:32 +0000 (18:39 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 2 Sep 2008 18:39:32 +0000 (18:39 +0000)
gcc/
* simplify-rtx.c (simplify_binary_operation_1): Check for CONST,
SYMBOL_REF and LABEL_REF when applying plus_constant, instead of
checking for a non-VOID CONSTANT_P.

From-SVN: r139903

gcc/ChangeLog
gcc/simplify-rtx.c

index 4a1b44c..b01292a 100644 (file)
@@ -1,3 +1,9 @@
+2008-09-02  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * simplify-rtx.c (simplify_binary_operation_1): Check for CONST,
+       SYMBOL_REF and LABEL_REF when applying plus_constant, instead of
+       checking for a non-VOID CONSTANT_P.
+
 2008-09-02  Jan Hubicka  <jh@suse.cz>
 
        * predict.c (pass_strip_predict_hints): Avoid bugs dump file.
index 30bafea..c7cd218 100644 (file)
@@ -1594,10 +1594,14 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
         to CONST_INT since overflow won't be computed properly if wider
         than HOST_BITS_PER_WIDE_INT.  */
 
-      if (CONSTANT_P (op0) && GET_MODE (op0) != VOIDmode
+      if ((GET_CODE (op0) == CONST
+          || GET_CODE (op0) == SYMBOL_REF
+          || GET_CODE (op0) == LABEL_REF)
          && GET_CODE (op1) == CONST_INT)
        return plus_constant (op0, INTVAL (op1));
-      else if (CONSTANT_P (op1) && GET_MODE (op1) != VOIDmode
+      else if ((GET_CODE (op1) == CONST
+               || GET_CODE (op1) == SYMBOL_REF
+               || GET_CODE (op1) == LABEL_REF)
               && GET_CODE (op0) == CONST_INT)
        return plus_constant (op1, INTVAL (op0));