diff options
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; +} |