combine.c (combine_simplify_rtx): If the modes are all VOIDmode, check the original...
authorDJ Delorie <dj@redhat.com>
Wed, 24 Jan 2001 21:10:06 +0000 (16:10 -0500)
committerDJ Delorie <dj@gcc.gnu.org>
Wed, 24 Jan 2001 21:10:06 +0000 (16:10 -0500)
* combine.c (combine_simplify_rtx): If the modes are all VOIDmode,
check the original operand's mode also.
* simplify-rtx.c (simplify_ternary_operation): Ditto.

From-SVN: r39247

gcc/ChangeLog
gcc/combine.c
gcc/simplify-rtx.c

index 9f8b613c7731fa7cbb8e7896fb970c57abb115c3..8dc545edda7d5449389f22aa2d1b9ed6ed78fae3 100644 (file)
@@ -1,3 +1,9 @@
+2001-01-24  DJ Delorie  <dj@redhat.com>
+
+       * combine.c (combine_simplify_rtx): If the modes are all VOIDmode,
+       check the original operand's mode also.
+       * simplify-rtx.c (simplify_ternary_operation): Ditto.
+
 2001-01-24  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * c-parse.in (cast_expr): Move compound literals from here ...
index 6028f6ae8d1fec5d67755460b7620a84c4d5ca47..8d7c9ccd65c515b2c49991026863e71911db1257 100644 (file)
@@ -3654,7 +3654,11 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
       {
        enum machine_mode cmp_mode = GET_MODE (XEXP (x, 0));
        if (cmp_mode == VOIDmode)
-         cmp_mode = GET_MODE (XEXP (x, 1));
+         {
+           cmp_mode = GET_MODE (XEXP (x, 1));
+           if (cmp_mode == VOIDmode)
+             cmp_mode = op0_mode;
+         }
        temp = simplify_relational_operation (code, cmp_mode,
                                              XEXP (x, 0), XEXP (x, 1));
       }
index 9b0f79876ddee3b6eb621696da044a7a7368e0b6..82bb8e40024bc9c075581e2bf112329bd6676ffd 100644 (file)
@@ -2057,6 +2057,8 @@ simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2)
          enum machine_mode cmp_mode = (GET_MODE (XEXP (op0, 0)) == VOIDmode
                                        ? GET_MODE (XEXP (op0, 1))
                                        : GET_MODE (XEXP (op0, 0)));
+         if (cmp_mode == VOIDmode)
+           cmp_mode = op0_mode;
          rtx temp
             = simplify_relational_operation (GET_CODE (op0), cmp_mode,
                                              XEXP (op0, 0), XEXP (op0, 1));