OSDN Git Service

PR rtl-optimization/19800
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Feb 2005 05:39:05 +0000 (05:39 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Feb 2005 05:39:05 +0000 (05:39 +0000)
* simplify_rtx.c (simplify_relational_operaration_1): Explicitly
call gen_lowpart_common and gen_lowpart_SUBREG instead of calling
gen_lowpart.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94691 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/simplify-rtx.c

index 48af628..9064d84 100644 (file)
@@ -1,3 +1,10 @@
+2005-02-06  Roger Sayle  <roger@eyesopen.com>
+
+       PR rtl-optimization/19800
+       * simplify_rtx.c (simplify_relational_operaration_1): Explicitly
+       call gen_lowpart_common and gen_lowpart_SUBREG instead of calling
+       gen_lowpart.
+
 2005-02-07  Ralf Corsepius  <ralf.corsepius@rtems.org>
 
        * config/m68k/t-rtems (MULTILIB_MATCHES): Let m528x match m5200.
index f23dba7..a92fc3c 100644 (file)
@@ -2888,9 +2888,17 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode,
       && cmp_mode != VOIDmode
       && nonzero_bits (op0, cmp_mode) == 1
       && STORE_FLAG_VALUE == 1)
-    return GET_MODE_SIZE (mode) > GET_MODE_SIZE (cmp_mode)
-          ? simplify_gen_unary (ZERO_EXTEND, mode, op0, cmp_mode)
-          : gen_lowpart (mode, op0);
+    {
+      rtx tmp;
+      if (GET_MODE_SIZE (mode) > GET_MODE_SIZE (cmp_mode))
+       return simplify_gen_unary (ZERO_EXTEND, mode, op0, cmp_mode);
+      tmp = gen_lowpart_common (mode, op0);
+      if (tmp)
+       return tmp;
+      if (GET_MODE (op0) != mode)
+       return gen_lowpart_SUBREG (mode, op0);
+      return op0;
+    }
 
   return NULL_RTX;
 }