------- Comment #20 from rakdver at gcc dot gnu dot org  2005-12-06 15:43 
-------
This patch should fix the problem:

Index: tree-scalar-evolution.c
===================================================================
*** tree-scalar-evolution.c     (revision 108078)
--- tree-scalar-evolution.c     (working copy)
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1042,1047 ****
--- 1042,1048 ----
    t_bool res = t_false;
    tree rhs0, rhs1;
    tree type_rhs = TREE_TYPE (rhs);
+   tree evol;

    /* The RHS is one of the following cases:
       - an SSA_NAME,
*************** follow_ssa_edge_in_rhs (struct loop *loo
*** 1084,1097 ****
            {
              /* Match an assignment under the form:
                 "a = b + c".  */
              res = follow_ssa_edge
                (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
!                evolution_of_loop, limit);

              if (res == t_true)
                *evolution_of_loop = add_to_evolution
                  (loop->num,
!                  chrec_convert (type_rhs, *evolution_of_loop, at_stmt),
                   PLUS_EXPR, rhs1);

              else if (res == t_false)
--- 1085,1099 ----
            {
              /* Match an assignment under the form:
                 "a = b + c".  */
+             evol = *evolution_of_loop;
              res = follow_ssa_edge
                (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
!                &evol, limit);

              if (res == t_true)
                *evolution_of_loop = add_to_evolution
                  (loop->num,
!                  chrec_convert (type_rhs, evol, at_stmt),
                   PLUS_EXPR, rhs1);

              else if (res == t_false)


-- 


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

Reply via email to