Commit e36dc339 by Zdenek Dvorak Committed by Zdenek Dvorak

re PR tree-optimization/40087 (Number of iterations analysis wrong)

	PR tree-optimization/40087
	* tree-ssa-loop-niter.c (number_of_iterations_ne_max,
	number_of_iterations_ne): Rename never_infinite argument.
	(number_of_iterations_lt_to_ne, number_of_iterations_lt,
	number_of_iterations_le): Handle pointer-type ivs when
	exit_must_be_taken is false.
	(number_of_iterations_cond):  Do not always assume that
	exit_must_be_taken if the control variable is a pointer.

	* gcc.dg/tree-ssa/pr40087.c: New test.

From-SVN: r147727
parent 03d33c2a
2009-05-19 Zdenek Dvorak <ook@ucw.cz>
PR tree-optimization/40087
* tree-ssa-loop-niter.c (number_of_iterations_ne_max,
number_of_iterations_ne): Rename never_infinite argument.
(number_of_iterations_lt_to_ne, number_of_iterations_lt,
number_of_iterations_le): Handle pointer-type ivs when
exit_must_be_taken is false.
(number_of_iterations_cond): Do not always assume that
exit_must_be_taken if the control variable is a pointer.
2009-05-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
* c-typeck.c (build_binary_op): Allow % on integal vectors.
......
2009-05-19 Zdenek Dvorak <ook@ucw.cz>
PR tree-optimization/40087
* gcc.dg/tree-ssa/pr40087.c: New test.
2009-05-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
* gcc.dg/vector-4.c: New testcase.
......
/* { dg-do run } */
/* { dg-options "-O1 " } */
extern void abort (void);
static void __attribute__((always_inline))
reverse(int *first, int *last)
{
if (first == last--)
return;
while (first != last)
{
int t = *first;
*first = *last;
*last = t;
if (++first == last--)
break;
}
}
int main()
{
int seq[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
reverse(seq, seq + 8);
if (seq[3] != 5 || seq[4] != 4)
abort ();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment