]> gcc.gnu.org Git - gcc.git/commitdiff
Index: ChangeLog
authorGeoffrey Keating <geoffk@redhat.com>
Wed, 27 Feb 2002 20:27:38 +0000 (20:27 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Wed, 27 Feb 2002 20:27:38 +0000 (20:27 +0000)
* expmed.c (expand_shift): Correctly test for low part of a
subreg.

Index: testsuite/ChangeLog

* gcc.c-torture/execute/20020225-2.c: New test.

From-SVN: r50114

gcc/ChangeLog
gcc/expmed.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20020225-2.c [new file with mode: 0644]

index 7722a6d333240ff214c91578439c18fc5ae7262c..42fd508ba72c62bbc410512353595c5ecb952d50 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-27  Geoffrey Keating  <geoffk@redhat.com>
+
+       * expmed.c (expand_shift): Correctly test for low part of a
+       subreg.
+
 2002-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * config/s390/s390.c (s390_chunkify_pool): Do not confuse
index b3d94c2376f8a194684a37adb9adaac3cf87569e..46007a3033019724d10a46911334cdf06c2e0465 100644 (file)
@@ -1913,7 +1913,7 @@ expand_shift (code, mode, shifted, amount, target, unsignedp)
         op1 = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (op1)
                       % GET_MODE_BITSIZE (mode));
       else if (GET_CODE (op1) == SUBREG
-              && SUBREG_BYTE (op1) == 0)
+              && subreg_lowpart_p (op1))
        op1 = SUBREG_REG (op1);
     }
 #endif
index b2820d62bab7831095a733be23fa08084be30603..d6b70d39409ac11a4a6561f67ec8c99e592bd457 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-27  Geoffrey Keating  <geoffk@redhat.com>
+
+       * gcc.c-torture/execute/20020225-2.c: New test.
+
 2002-02-27  Zack Weinberg  <zack@codesourcery.com>
 
        * gcc.c-torture/execute/920730-1t.c,
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020225-2.c b/gcc/testsuite/gcc.c-torture/execute/20020225-2.c
new file mode 100644 (file)
index 0000000..5c91596
--- /dev/null
@@ -0,0 +1,19 @@
+static int 
+test(int x)
+{
+  union 
+    {
+      int i;
+      double d;
+  } a;
+  a.d = 0;
+  a.i = 1;
+  return x >> a.i;
+}
+
+int main(void)
+{
+  if (test (5) != 2)
+    abort ();
+  exit (0);
+}
This page took 0.095518 seconds and 5 git commands to generate.