From: Richard Guenther Date: Wed, 4 Jul 2007 12:39:42 +0000 (+0000) Subject: re PR tree-optimization/32500 (Loop optimization limits range to size of array used... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d8c27ffa274c9dcaecc29421e3dbec08077be72;p=gcc.git re PR tree-optimization/32500 (Loop optimization limits range to size of array used inside loop) 2007-07-04 Richard Guenther PR tree-optimization/32500 * gcc.c-torture/execute/pr32500.c: New testcase. From-SVN: r126316 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a0c07456ac6..261286e57c3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-07-04 Richard Guenther + + PR tree-optimization/32500 + * gcc.c-torture/execute/pr32500.c: New testcase. + 2007-07-04 Richard Guenther PR tree-optimization/32482 diff --git a/gcc/testsuite/gcc.c-torture/execute/pr32500.c b/gcc/testsuite/gcc.c-torture/execute/pr32500.c new file mode 100644 index 00000000000..dae06ea3a25 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr32500.c @@ -0,0 +1,26 @@ +extern void abort(void); +extern void exit(int); +void foo(int) __attribute__((noinline)); +void bar(void) __attribute__((noinline)); + +/* Make sure foo is not inlined or considered pure/const. */ +int x; +void foo(int i) { x = i; } +void bar(void) { exit(0); } + +int +main(int argc, char *argv[]) +{ + int i; + int numbers[4] = { 0xdead, 0xbeef, 0x1337, 0x4242 }; + + for (i = 1; i <= 12; i++) { + if (i <= 4) + foo(numbers[i]); + else if (i >= 7 && i <= 9) + bar(); + } + + abort(); +} +