re PR tree-optimization/22348 (Execution continues past end of for loop end condition with optimisation enabled)
PR tree-optimize/22348 * tree-ssa-loop-niter.c (number_of_iterations_cond): Fold the partial computation. * gcc.c-torture/execute/pr22348.c: New. From-SVN: r102427
This commit is contained in:
parent
3ac01fdeef
commit
26c406400e
@ -1,3 +1,9 @@
|
||||
2005-07-27 Zdenek Dvorak <dvorakz@suse.cz>
|
||||
|
||||
PR tree-optimize/22348
|
||||
* tree-ssa-loop-niter.c (number_of_iterations_cond):
|
||||
Fold the partial computation.
|
||||
|
||||
2005-07-27 Zdenek Dvorak <dvorakz@suse.cz>
|
||||
|
||||
PR tree-optimization/22325
|
||||
|
@ -1,3 +1,8 @@
|
||||
2005-07-27 Zdenek Dvorak <dvorakz@suse.cz>
|
||||
|
||||
PR tree-optimize/22348
|
||||
* gcc.c-torture/execute/pr22348.c: New.
|
||||
|
||||
2005-07-27 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
* gcc.dg/tree-ssa/salias-1.c: New testcase.
|
||||
|
15
gcc/testsuite/gcc.c-torture/execute/pr22348.c
Normal file
15
gcc/testsuite/gcc.c-torture/execute/pr22348.c
Normal file
@ -0,0 +1,15 @@
|
||||
void abort (void);
|
||||
void f(int i)
|
||||
{
|
||||
if (i>4 + 3 * 16)
|
||||
abort();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
unsigned int buflen, i;
|
||||
buflen = 4 + 3 * 16;
|
||||
for (i = 4; i < buflen; i+= 3)
|
||||
f(i);
|
||||
return 0;
|
||||
}
|
@ -275,7 +275,7 @@ number_of_iterations_cond (tree type, tree base0, tree step0,
|
||||
step = fold_unary_to_constant (NEGATE_EXPR, type, step1);
|
||||
else
|
||||
step = step0;
|
||||
delta = build2 (MINUS_EXPR, type, base1, base0);
|
||||
delta = fold_build2 (MINUS_EXPR, type, base1, base0);
|
||||
delta = fold_build2 (FLOOR_MOD_EXPR, type, delta, step);
|
||||
may_xform = boolean_false_node;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user