re PR rtl-optimization/10312 (optimizer creates wrong code for loop)
authorZdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
Mon, 15 Dec 2003 09:37:03 +0000 (10:37 +0100)
committerZdenek Dvorak <rakdver@gcc.gnu.org>
Mon, 15 Dec 2003 09:37:03 +0000 (09:37 +0000)
PR optimization/10312
* gcc.c-torture/execute/20031214-1.c: New.

From-SVN: r74625

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

index ee586f53282e620200bf48fdf7bba0d598ccc72e..d44759f3cd538f0456a23b464707317645baa28a 100644 (file)
@@ -1,3 +1,8 @@
+2003-12-15  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+
+       PR optimization/10312
+       * gcc.c-torture/execute/20031214-1.c: New.
+
 2003-12-14  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/10779
diff --git a/gcc/testsuite/gcc.c-torture/execute/20031214-1.c b/gcc/testsuite/gcc.c-torture/execute/20031214-1.c
new file mode 100644 (file)
index 0000000..e52200c
--- /dev/null
@@ -0,0 +1,32 @@
+/* PR optimization/10312 */
+/* Originator: Peter van Hoof <p dot van-hoof at qub dot ac dot uk> */
+
+/* Verify that the strength reduction pass doesn't find
+   illegitimate givs.  */
+
+struct
+{
+  double a;
+  int n[2];
+} g = { 0., { 1, 2}};
+
+int k = 0;
+
+void
+b (int *j)
+{
+}
+
+int
+main ()
+{
+  int j;
+
+  for (j = 0; j < 2; j++)
+    k = (k > g.n[j]) ? k : g.n[j];
+
+  k++;
+  b (&j);
+
+  return 0;
+}