simplify-rtx.c (simplify_binary_operation): Simplify contents of CONST.
authorRichard Henderson <rth@redhat.com>
Thu, 6 Sep 2001 22:14:43 +0000 (15:14 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 6 Sep 2001 22:14:43 +0000 (15:14 -0700)
        * simplify-rtx.c (simplify_binary_operation): Simplify contents
        of CONST.

From-SVN: r45447

gcc/ChangeLog
gcc/simplify-rtx.c

index 7c4929831a63c28ab47ea3ebf2a5353163c32ba1..16c65e2b0639158ee5769e03c2d544a539edb5e4 100644 (file)
@@ -1,3 +1,8 @@
+2001-09-06  Richard Henderson  <rth@redhat.com>
+
+       * simplify-rtx.c (simplify_binary_operation): Simplify contents
+       of CONST.
+
 2001-09-06  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
 
        * config/rs6000/rs6000.c (rs6000_emit_prologue): Fix DWARF2 register
index ea1cc6d285a6a1d9199ba2ff7dabeef6286566ce..7f358d3ddc4cf117c3f7477f739f560c0c9d3284 100644 (file)
@@ -1275,6 +1275,28 @@ simplify_binary_operation (code, mode, op0, op1)
               return simplify_gen_binary (AND, mode, op0,
                                           gen_rtx_NOT (mode, XEXP (op1, 0)));
           }
+
+         /* Simplify operations with constants containing embedded offsets.  */
+         if (GET_CODE (op0) == CONST)
+           {
+             tem = simplify_binary_operation (code, mode, XEXP (op0, 0), op1);
+             if (tem)
+               {
+                 if (CONSTANT_P (op1) && ! CONSTANT_P (tem))
+                   tem = gen_rtx_CONST (mode, tem);
+                 return tem;
+               }
+           }
+         if (GET_CODE (op1) == CONST)
+           {
+             tem = simplify_binary_operation (code, mode, op0, XEXP (op1, 0));
+             if (tem)
+               {
+                 if (CONSTANT_P (op0) && ! CONSTANT_P (tem))
+                   tem = gen_rtx_CONST (mode, tem);
+                 return tem;
+               }
+           }
          break;
 
        case MULT: