re PR rtl-optimization/27538 (execute/20030128-1.c FAILs)
authorRoger Sayle <roger@eyesopen.com>
Sun, 14 May 2006 16:07:12 +0000 (16:07 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 14 May 2006 16:07:12 +0000 (16:07 +0000)
PR rtl-optimization/27538
* combine.c (expand_compound_operation): Call gen_lowpart
before calling simplify_shift_const.

From-SVN: r113763

gcc/ChangeLog
gcc/combine.c

index 1c6df66f205ea2d0734d9e080d04d33f2629a629..c5ed8fc4ce5e900e98f0f5b2194fdd996dfd109f 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-14  Roger Sayle  <roger@eyesopen.com>
+
+       PR rtl-optimization/27538
+       * combine.c (expand_compound_operation): Call gen_lowpart
+       before calling simplify_shift_const.
+
 2006-05-14  Roger Sayle  <roger@eyesopen.com>
 
        PR rtl-optimization/22563
index ed9c497e7d525c33555d668ea6f8578fa10d75ba..33512ec46359339a968c7efbb97c717cef45fe5e 100644 (file)
@@ -5736,14 +5736,16 @@ expand_compound_operation (rtx x)
 
   modewidth = GET_MODE_BITSIZE (GET_MODE (x));
   if (modewidth + len >= pos)
-    tem = simplify_shift_const (NULL_RTX, unsignedp ? LSHIFTRT : ASHIFTRT,
-                               GET_MODE (x),
-                               simplify_shift_const (NULL_RTX, ASHIFT,
-                                                     GET_MODE (x),
-                                                     XEXP (x, 0),
-                                                     modewidth - pos - len),
-                               modewidth - len);
-
+    {
+      enum machine_mode mode = GET_MODE (x);
+      tem = gen_lowpart (mode, XEXP (x, 0));
+      if (!tem || GET_CODE (tem) == CLOBBER)
+       return x;
+      tem = simplify_shift_const (NULL_RTX, ASHIFT, mode,
+                                 tem, modewidth - pos - len);
+      tem = simplify_shift_const (NULL_RTX, unsignedp ? LSHIFTRT : ASHIFTRT,
+                                 mode, tem, modewidth - len);
+    }
   else if (unsignedp && len < HOST_BITS_PER_WIDE_INT)
     tem = simplify_and_const_int (NULL_RTX, GET_MODE (x),
                                  simplify_shift_const (NULL_RTX, LSHIFTRT,