diff options
author | Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> | 2003-12-15 10:37:03 +0100 |
---|---|---|
committer | Zdenek Dvorak <rakdver@gcc.gnu.org> | 2003-12-15 09:37:03 +0000 |
commit | 298a037c2a022d84e5179c57591a47de88596e6a (patch) | |
tree | 763db400098286d9e6e2d5a06e9e2130bf5e93fc /gcc | |
parent | 4bb8ca281f0fb91d296116d2b7496b216c7c1bb3 (diff) | |
download | gcc-298a037c2a022d84e5179c57591a47de88596e6a.zip gcc-298a037c2a022d84e5179c57591a47de88596e6a.tar.gz gcc-298a037c2a022d84e5179c57591a47de88596e6a.tar.bz2 |
re PR rtl-optimization/10312 (optimizer creates wrong code for loop)
PR optimization/10312
* gcc.c-torture/execute/20031214-1.c: New.
From-SVN: r74625
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20031214-1.c | 32 |
2 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ee586f5..d44759f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..e52200c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20031214-1.c @@ -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; +} |