diff options
Diffstat (limited to 'gcc/tree-ssa-loop-ivopts.c')
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 5c667a2..00b287a 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -1853,6 +1853,11 @@ find_deriving_biv_for_expr (struct ivopts_data *data, tree expr) { ssa_op_iter iter; use_operand_p use_p; + basic_block phi_bb = gimple_bb (phi); + + /* Skip loop header PHI that doesn't define biv. */ + if (phi_bb->loop_father == data->current_loop) + return NULL; if (virtual_operand_p (gimple_phi_result (phi))) return NULL; |