From: Jakub Jelinek Date: Tue, 9 Dec 2008 22:47:20 +0000 (+0100) Subject: re PR tree-optimization/37416 (Failure to return number of loop iterations) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=218d1c24bb8bd00b49a4c9097b5777a2c25ba231;p=gcc.git re PR tree-optimization/37416 (Failure to return number of loop iterations) PR tree-optimization/37416 * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Handle NOP_EXPR. From-SVN: r142616 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9d9fd74696..431a97a1aaa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-12-09 Jakub Jelinek + + PR tree-optimization/37416 + * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Handle NOP_EXPR. + 2008-12-09 Janis Johnson * doc/sourcebuild.texi (Test Directives): Fix formatting. diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 51bbd4bcdcb..e3d60e98b2e 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -1229,6 +1229,18 @@ follow_ssa_edge_in_rhs (struct loop *loop, gimple stmt, case GIMPLE_SINGLE_RHS: return follow_ssa_edge_expr (loop, stmt, gimple_assign_rhs1 (stmt), halting_phi, evolution_of_loop, limit); + case GIMPLE_UNARY_RHS: + if (code == NOP_EXPR) + { + /* This assignment is under the form "a_1 = (cast) rhs. */ + t_bool res + = follow_ssa_edge_expr (loop, stmt, gimple_assign_rhs1 (stmt), + halting_phi, evolution_of_loop, limit); + *evolution_of_loop = chrec_convert (type, *evolution_of_loop, stmt); + return res; + } + /* FALLTHRU */ + default: return t_false; }