]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/39417 (Incorrect values computed with -ftree-copy-prop)
authorRichard Guenther <rguenther@suse.de>
Tue, 20 Apr 2010 14:18:35 +0000 (14:18 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 20 Apr 2010 14:18:35 +0000 (14:18 +0000)
2010-04-20  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/39417
* g++.dg/torture/pr39417.C: New testcase.

From-SVN: r158560

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr39417.C [new file with mode: 0644]

index 08619dac9522f16cda3f85ee055f1176f1686412..ff7904ba5ba4d9bf51458d6d0f2447feb96a0067 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-20  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/39417
+       * g++.dg/torture/pr39417.C: New testcase.
+
 2010-04-20  Richard Guenther  <rguenther@suse.de>
 
        * gcc.dg/ipa/ipa-pta-14.c: New testcase.
diff --git a/gcc/testsuite/g++.dg/torture/pr39417.C b/gcc/testsuite/g++.dg/torture/pr39417.C
new file mode 100644 (file)
index 0000000..b7bbb88
--- /dev/null
@@ -0,0 +1,56 @@
+// { dg-do run }
+
+#include <vector>
+
+std::vector <int>
+sequence(int l, int n)
+{
+  std::vector <int> ret;
+  for(int i=n;i<=100;i++)
+    {
+      if(i%2==0)
+       {
+         if(l%i==i/2)
+           {
+             int init =l/i-i/2+1;
+             if(init>=0)
+               {
+                 for(int j=0;j<i;j++)
+                   {
+                     ret.push_back(init);
+                     init ++;
+                   }
+                 break;
+               }
+           }
+       }
+      else
+       {
+         if(l%i==0)
+           {
+             int init =l/i-i/2;
+             if(init>=0)
+               {
+                 for(int j=0;j<i;j++)
+                   {
+                     ret.push_back(init);
+                     init ++;
+                   }
+                 break;
+               }
+           }
+       }
+    }
+  return ret;
+}
+extern "C" void abort (void);
+int main()
+{
+  std::vector<int> res = sequence(18, 2);
+  if (res.size () != 3
+      || res[0] != 5
+      || res[1] != 6
+      || res[2] != 7)
+    abort ();
+  return 0;
+}