------- Comment #10 from spop at gcc dot gnu dot org  2009-10-20 21:53 -------
Subject: Re:  [4.5 Regression] apparent integer 
        wrong code bug

> The problem is that we follow SSA edges into loops that may not be executed.

It is correct to follow SSA edges in loops that may not execute, as we
compute a symbolic expression of the evolution.

The error is that we are not careful enough in the use of this
symbolic information: in analyze_evolution_in_loop we are given the
loop_phi_node: a_lsm.6_15 = PHI <a_lsm.6_18(3), a_lsm.6_20(4)> and its
initial value init_cond: a_lsm.6_18.

follow_ssa_edge returns an evolution function ev_fn that could be
incompatible with the initial value:

(unsigned int) (short unsigned int) a_lsm.6_18;

The attached patch fixes the problem by returning "don't know" when
init_cond is not equal to ev_fn when no_evolution_in_loop_p manages to
prove that ev_fn is invariant in the loop.

Sebastian


------- Comment #11 from spop at gcc dot gnu dot org  2009-10-20 21:53 -------
Created an attachment (id=18847)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18847&action=view)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41497

Reply via email to