re PR tree-optimization/32500 (Loop optimization limits range to size of array used inside loop)

2007-07-04  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/32500
	* gcc.c-torture/execute/pr32500.c: New testcase.

From-SVN: r126316
This commit is contained in:
Richard Guenther 2007-07-04 12:39:42 +00:00 committed by Richard Biener
parent b0569227f5
commit 7d8c27ffa2
2 changed files with 31 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2007-07-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32500
* gcc.c-torture/execute/pr32500.c: New testcase.
2007-07-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32482

View File

@ -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();
}