aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-04-03 13:46:49 +0200
committerRichard Biener <rguenther@suse.de>2020-04-03 15:24:11 +0200
commitef6631051d4bb9519f3f0dd5f3b3eadbd67bc10a (patch)
tree1121c6c7c9d608e3d6bbcaedc27c2d5e10f0272a /gcc
parentfa4aab7f84061c7253de6c38162f5b71111f5139 (diff)
downloadgcc-ef6631051d4bb9519f3f0dd5f3b3eadbd67bc10a.zip
gcc-ef6631051d4bb9519f3f0dd5f3b3eadbd67bc10a.tar.gz
gcc-ef6631051d4bb9519f3f0dd5f3b3eadbd67bc10a.tar.bz2
middle-end/94465 - handle released SSA names in array_ref_low_bound
array_ref_low_bound is used in dumping ARRAY_REFs which in turn is called when basic blocks are deleted. cleanup_control_flow_pre consciously decides to remove unreachable basic-blocks in arbitrary order so the following makes array_ref_low_bound forgiving in the case the SSA name with the index definition has been released already. 2020-04-03 Richard Biener <rguenther@suse.de> PR middle-end/94465 * tree.c (array_ref_low_bound): Deal with released SSA names in index position.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 11510ac..540cf1b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-04-03 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/94465
+ * tree.c (array_ref_low_bound): Deal with released SSA names
+ in index position.
+
2020-04-03 Kwok Cheung Yeung <kcy@codesourcery.com>
* config/gcn/gcn.c (print_operand): Handle unordered comparison
diff --git a/gcc/tree.c b/gcc/tree.c
index 63dc673..0fe3afc 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -13426,7 +13426,9 @@ array_ref_low_bound (tree exp)
return SUBSTITUTE_PLACEHOLDER_IN_EXPR (TYPE_MIN_VALUE (domain_type), exp);
/* Otherwise, return a zero of the appropriate type. */
- return build_int_cst (TREE_TYPE (TREE_OPERAND (exp, 1)), 0);
+ tree idxtype = TREE_TYPE (TREE_OPERAND (exp, 1));
+ return (idxtype == error_mark_node
+ ? integer_zero_node : build_int_cst (idxtype, 0));
}
/* Return a tree representing the upper bound of the array mentioned in