This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[testcase] optimization/5076: gcc3 regression: yet another strengthreduction bug


On 11 Dec 2001 gbeauchesne@mandrakesoft.com wrote:

> The attached test case is extracted/reduced from PR 2847 that was
> closed earlier. gcc3 series compilers are affected, unlike gcc-2.95.X.
> (gcc-"2.96" is affected too).

Here is another testcase exhibing a strength reduction bug occurring with
FSF gcc 3.0.3 and binutils 2.11.92.0.12-2mdk (based on RH 2.11.92.0.12-8)
on i586-mandrake-linux-gnu. Also occurs with gcc 3.0.3 on IA-64 and with
mainline gcc (3.1 20020102) on IA-32. This is a regression from gcc
2.95.X.

Testcase is derived from PR optimization/5076 and PR optimization/2847.

2002-01-02  Gwenole Beauchesne  <gbeauchesne@mandrakesoft.com>

	PR optimization/5076, PR optimization/2847
	* gcc.c-torture/execute/loop-10.c: New test.

--- gcc/testsuite/gcc.c-torture/execute/loop-10.c.strength-reduce
Wed Jan  2 18:55:53 2002
+++ gcc/testsuite/gcc.c-torture/execute/loop-10.c	Wed Jan  2
18:54:03 2002
@@ -0,0 +1,31 @@
+/* Reduced from PR optimization/5076, PR optimization/2847 */
+
+static int count = 0;
+
+static void
+inc (void)
+{
+  count++;
+}
+
+int
+main (void)
+{
+  int iNbr = 1;
+  int test = 0;
+  while (test == 0)
+    {
+      inc ();
+      if (iNbr == 0)
+        break;
+      else
+        {
+          inc ();
+          iNbr--;
+        }
+      test = 1;
+    }
+  if (count != 2)
+    abort ();
+  return 0;
+}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]