re PR tree-optimization/39417 (Incorrect values computed with -ftree-copy-prop)
2010-04-20 Richard Guenther <rguenther@suse.de> PR tree-optimization/39417 * g++.dg/torture/pr39417.C: New testcase. From-SVN: r158560
This commit is contained in:
parent
3c323b522a
commit
48e5069861
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
Loading…
Reference in New Issue