]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
combine.c (simplify_comparison): Re-enable widening of comparisons with non-paradoxic...
authorUlrich Weigand <uweigand@de.ibm.com>
Mon, 25 Aug 2003 21:11:46 +0000 (21:11 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Mon, 25 Aug 2003 21:11:46 +0000 (21:11 +0000)
* combine.c (simplify_comparison): Re-enable widening of comparisons
with non-paradoxical subregs of non-REG expressions.

From-SVN: r70785

gcc/ChangeLog
gcc/combine.c

index a2bca73dbc99033fdfd1ce33e235a9c6f627cd33..e23a0e2e6c0fb0ffff321b2c6769418dd31c377d 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-25  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * combine.c (simplify_comparison): Re-enable widening of comparisons
+       with non-paradoxical subregs of non-REG expressions.
+
 2003-08-25  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * combine.c (distribute_notes): Handle REG_ALWAYS_RETURN.
index afa25b0357d054fd33d530b0f5e3bc6d3ff08120..cc7c7de156e2dad313220e871bbb808fd174334a 100644 (file)
@@ -11277,9 +11277,6 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
   op1 = make_compound_operation (op1, SET);
 
   if (GET_CODE (op0) == SUBREG && subreg_lowpart_p (op0)
-      /* Case 3 above, to sometimes allow (subreg (mem x)), isn't
-        implemented.  */
-      && GET_CODE (SUBREG_REG (op0)) == REG
       && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT
       && GET_MODE_CLASS (GET_MODE (SUBREG_REG (op0))) == MODE_INT
       && (code == NE || code == EQ))
@@ -11287,8 +11284,13 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
       if (GET_MODE_SIZE (GET_MODE (op0))
          > GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0))))
        {
-         op0 = SUBREG_REG (op0);
-         op1 = gen_lowpart_for_combine (GET_MODE (op0), op1);
+         /* For paradoxical subregs, allow case 1 as above.  Case 3 isn't
+            implemented.  */
+          if (GET_CODE (SUBREG_REG (op0)) == REG)
+           {
+             op0 = SUBREG_REG (op0);
+             op1 = gen_lowpart_for_combine (GET_MODE (op0), op1);
+           }
        }
       else if ((GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (op0)))
                <= HOST_BITS_PER_WIDE_INT)