diff options
Diffstat (limited to 'gcc/tree-ssa-dce.c')
-rw-r--r-- | gcc/tree-ssa-dce.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c index c1f4e7f647b..2eec3147886 100644 --- a/gcc/tree-ssa-dce.c +++ b/gcc/tree-ssa-dce.c @@ -951,6 +951,7 @@ forward_edge_to_pdom (edge e, basic_block post_dom_bb) { gimple phi = gsi_stmt (gsi); tree op; + source_location locus; /* Dead PHI do not imply control dependency. */ if (!gimple_plf (phi, STMT_NECESSARY) @@ -975,10 +976,16 @@ forward_edge_to_pdom (edge e, basic_block post_dom_bb) continue; } if (!e2) - op = gimple_phi_arg_def (phi, e->dest_idx == 0 ? 1 : 0); + { + op = gimple_phi_arg_def (phi, e->dest_idx == 0 ? 1 : 0); + locus = gimple_phi_arg_location (phi, e->dest_idx == 0 ? 1 : 0); + } else - op = gimple_phi_arg_def (phi, e2->dest_idx); - add_phi_arg (phi, op, e); + { + op = gimple_phi_arg_def (phi, e2->dest_idx); + locus = gimple_phi_arg_location (phi, e2->dest_idx); + } + add_phi_arg (phi, op, e, locus); gcc_assert (e2 || degenerate_phi_p (phi)); gsi_next (&gsi); } |