summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-06-26 07:19:37 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-06-26 07:19:37 +0000
commit25853b33482749fb6a07336ea3790a45cc1752f7 (patch)
treefb16b8aa818baf168138b04424264d43e2164300 /gcc/tree-ssa.c
parentddc36d5a1def2504956a9b40f31f09c5873e6349 (diff)
re PR tree-optimization/80928 (SLP vectorization does not handle induction in outer loop vectorization)
2017-06-26 Richard Biener <rguenther@suse.de> PR tree-optimization/80928 * cfghooks.c (duplicate_block): Do not copy BB_DUPLICATED flag. (copy_bbs): Set BB_DUPLICATED flag early. (execute_on_growing_pred): Do not execute for BB_DUPLICATED marked blocks. (execute_on_shrinking_pred): Likewise. * tree-ssa.c (ssa_redirect_edge): Do not look for PHI args in BB_DUPLICATED blocks. * tree-ssa-phionlycoprop.c (eliminate_degenerate_phis_1): Properly iterate over all PHIs considering removal of *gsi. From-SVN: r249638
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 45b9951bf25..fa8f81e9a1a 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -142,21 +142,24 @@ ssa_redirect_edge (edge e, basic_block dest)
redirect_edge_var_map_clear (e);
- /* Remove the appropriate PHI arguments in E's destination block. */
- for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi))
- {
- tree def;
- source_location locus ;
-
- phi = gsi.phi ();
- def = gimple_phi_arg_def (phi, e->dest_idx);
- locus = gimple_phi_arg_location (phi, e->dest_idx);
-
- if (def == NULL_TREE)
- continue;
-
- redirect_edge_var_map_add (e, gimple_phi_result (phi), def, locus);
- }
+ /* Remove the appropriate PHI arguments in E's destination block.
+ If we are redirecting a copied edge the destination has not
+ got PHI argument space reserved nor an interesting argument. */
+ if (! (e->dest->flags & BB_DUPLICATED))
+ for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ tree def;
+ source_location locus ;
+
+ phi = gsi.phi ();
+ def = gimple_phi_arg_def (phi, e->dest_idx);
+ locus = gimple_phi_arg_location (phi, e->dest_idx);
+
+ if (def == NULL_TREE)
+ continue;
+
+ redirect_edge_var_map_add (e, gimple_phi_result (phi), def, locus);
+ }
e = redirect_edge_succ_nodup (e, dest);