simplify-rtx.c (simplify_const_relational_operation): When extracting arguments of...
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 16 Aug 2005 02:01:27 +0000 (02:01 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Tue, 16 Aug 2005 02:01:27 +0000 (02:01 +0000)
* simplify-rtx.c (simplify_const_relational_operation): When
extracting arguments of a COMPARE, recompute the mode as well.

From-SVN: r103143

gcc/ChangeLog
gcc/simplify-rtx.c

index 50148e205d02a5389361886856a89c4b624e471a..f4960d60a2f26925307f0a1eef336bd8eac282fd 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-15  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * simplify-rtx.c (simplify_const_relational_operation): When
+       extracting arguments of a COMPARE, recompute the mode as well.
+
 2005-08-15  Ian Lance Taylor  <ian@airs.com>
 
        * tree.c (build_string): Mark tree CONSTANT and INVARIANT.
index e3e29991af8f9b11d396da6139a7593f1ce1b721..ca9d9dab4a56fc5357c5b7390fa61fa46ace1fef 100644 (file)
@@ -3014,7 +3014,17 @@ simplify_const_relational_operation (enum rtx_code code,
 
   /* If op0 is a compare, extract the comparison arguments from it.  */
   if (GET_CODE (op0) == COMPARE && op1 == const0_rtx)
-    op1 = XEXP (op0, 1), op0 = XEXP (op0, 0);
+    {
+      op1 = XEXP (op0, 1);
+      op0 = XEXP (op0, 0);
+
+      if (GET_MODE (op0) != VOIDmode)
+       mode = GET_MODE (op0);
+      else if (GET_MODE (op1) != VOIDmode)
+       mode = GET_MODE (op1);
+      else
+       return 0;
+    }
 
   /* We can't simplify MODE_CC values since we don't know what the
      actual comparison is.  */