re PR rtl-optimization/3311 (GCC-SH: gcc loses result of AND operation due to force_t...
authorJeff Law <law@redhat.com>
Thu, 9 May 2002 13:33:58 +0000 (07:33 -0600)
committerJeff Law <law@gcc.gnu.org>
Thu, 9 May 2002 13:33:58 +0000 (07:33 -0600)
Forgot to commit long long ago.  See my message to gcc-patches from
Mar 28 :-)  Testcase for PR 3311.

From-SVN: r53328

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20020328-1.c [new file with mode: 0644]

index bcecf51d0ac3fb86a306968a8055e360e2d85ced..5e060c43db8d00b69737331d72b409c9ec3ad2d4 100644 (file)
@@ -487,6 +487,10 @@ Wed Apr 24 21:38:36 2002  J"orn Rennecke <joern.rennecke@superh.com>
 
        * g++.old-deja/g++.law/bit-fields2.C: Skip on mmix-knuth-mmixware.
 
+Thu Mar 28 16:38:09 2002  Jeffrey A Law  (law@redhat.com)
+
+       * gcc.c-torture/execute/20020328-1.c: New test.
+
 2002-03-27  Richard Henderson  <rth@redhat.com>
 
        * g++.dg/ext/instantiate1.C: Use scan-assembler, not link errors.
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020328-1.c b/gcc/testsuite/gcc.c-torture/execute/20020328-1.c
new file mode 100644 (file)
index 0000000..4b6f2bf
--- /dev/null
@@ -0,0 +1,25 @@
+int b = 0;
+
+func () { }
+
+void
+testit(int x)
+{
+  if (x != 20)
+    abort ();
+}
+
+int
+main()
+
+{
+  int a = 0;
+
+  if (b)
+    func();
+
+  /* simplify_and_const_int would incorrectly omit the mask in
+     the line below.  */
+  testit ((a + 23) & 0xfffffffc);
+  exit (0);
+}