diff options
author | Richard Biener <rguenther@suse.de> | 2020-08-06 12:18:24 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-08-06 12:19:48 +0200 |
commit | 89b84cd794f984038984c10b03c3b0ab582f49cc (patch) | |
tree | f078aa30750b4b3ac5fba4c8e64b475442e68a69 /gcc/tree-ssa-sink.c | |
parent | 1f4c8afa1b2dac97f2ee78eacafe6eee246a4dae (diff) | |
download | gcc-89b84cd794f984038984c10b03c3b0ab582f49cc.zip gcc-89b84cd794f984038984c10b03c3b0ab582f49cc.tar.gz gcc-89b84cd794f984038984c10b03c3b0ab582f49cc.tar.bz2 |
tree-optimization/96491 - avoid store commoning across abnormal edges
This avoids store commoning across abnormal edges since that easily
can disrupt abnormal coalescing because it might create overlapping
lifetime of variables.
2020-08-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/96491
* tree-ssa-sink.c (sink_common_stores_to_bb): Avoid
sinking across abnormal edges.
* gcc.dg/torture/pr96491.c: New testcase.
Diffstat (limited to 'gcc/tree-ssa-sink.c')
-rw-r--r-- | gcc/tree-ssa-sink.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c index 962ad07..4cc5195 100644 --- a/gcc/tree-ssa-sink.c +++ b/gcc/tree-ssa-sink.c @@ -503,7 +503,8 @@ sink_common_stores_to_bb (basic_block bb) tree arg = gimple_phi_arg_def (phi, i); gimple *def = SSA_NAME_DEF_STMT (arg); if (! is_gimple_assign (def) - || stmt_can_throw_internal (cfun, def)) + || stmt_can_throw_internal (cfun, def) + || (gimple_phi_arg_edge (phi, i)->flags & EDGE_ABNORMAL)) { /* ??? We could handle some cascading with the def being another PHI. We'd have to insert multiple PHIs for |