This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Some ivopts improvements


Hello,

> On Mon, May 16, 2005 at 09:24:29PM +0200, Zdenek Dvorak wrote:
> > 2) number_of_iterations_cond uses tree_expr_nonnegative_p to detect
> >    whether we are not dealing with paradoxical loops.  This test fails 
> >    when the control variable is unsigned, since then
> >    tree_expr_nonnegative_p is always true.
> 
> Got a test case for this one?

we are unable to determine number of iterations in
number_of_iterations_cond for example for

void foo (void)
{
  unsigned a;

  for (a = 10; a > 5; a -= 2)
    bla ();
}

(the problem is masked, however -- we determine the number of
iterations by brute force evaluation in the ivcanon pass).
I will add a testcase to testsuite.

Zdenek

> > 	* tree-ssa-loop-ivopts.c (find_bivs, find_givs_in_stmt_scev): Apply
> > 	expand_simple_operations to bases of the ivs.
> > 	(tree_int_cst_sign_bit): Export.
> > 	* tree-flow.h (expand_simple_operations): Declare.
> > 	* tree-ssa-loop-niter.c (number_of_iterations_cond): Use
> > 	tree_int_cst_sign_bit.
> > 	(expand_simple_operations): Export.
> > 	* tree.h (tree_int_cst_sign_bit): Declare.
> 
> Ok.
> 
> 
> r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]