aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-complex.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-11-19 09:06:50 +0100
committerRichard Biener <rguenther@suse.de>2020-11-19 09:57:38 +0100
commit0d8290959ecf2c5f1dd062e57782b5e91be0f8f6 (patch)
treebe1ae52e391d9cd7ac8dc246f4bfc0f5da8e81ae /gcc/tree-complex.c
parent50134189a434e638861f8bf27d5caab9622811c8 (diff)
downloadgcc-0d8290959ecf2c5f1dd062e57782b5e91be0f8f6.zip
gcc-0d8290959ecf2c5f1dd062e57782b5e91be0f8f6.tar.gz
gcc-0d8290959ecf2c5f1dd062e57782b5e91be0f8f6.tar.bz2
tree-optimization/97897 - complex lowering on abnormal edges
This fixes complex lowering to not put constants into abnormal edge PHI values by making sure abnormally used SSA names are VARYING in its propagation lattice. 2020-11-19 Richard Biener <rguenther@suse.de> PR tree-optimization/97897 * tree-complex.c (complex_propagate::visit_stmt): Make sure abnormally used SSA names are VARYING. (complex_propagate::visit_phi): Likewise. * tree-ssa.c (verify_phi_args): Verify PHI arguments on abnormal edges are SSA names. * gcc.dg/pr97897.c: New testcase.
Diffstat (limited to 'gcc/tree-complex.c')
-rw-r--r--gcc/tree-complex.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index f132e0f..1cfb3e8 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -318,7 +318,7 @@ complex_propagate::visit_stmt (gimple *stmt, edge *taken_edge_p ATTRIBUTE_UNUSED
lhs = gimple_get_lhs (stmt);
/* Skip anything but GIMPLE_ASSIGN and GIMPLE_CALL with a lhs. */
- if (!lhs)
+ if (!lhs || SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
return SSA_PROP_VARYING;
/* These conditions should be satisfied due to the initial filter
@@ -417,6 +417,9 @@ complex_propagate::visit_phi (gphi *phi)
set up in init_dont_simulate_again. */
gcc_assert (TREE_CODE (TREE_TYPE (lhs)) == COMPLEX_TYPE);
+ if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ return SSA_PROP_VARYING;
+
/* We've set up the lattice values such that IOR neatly models PHI meet. */
new_l = UNINITIALIZED;
for (i = gimple_phi_num_args (phi) - 1; i >= 0; --i)