]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
middle-end/94465 - handle released SSA names in array_ref_low_bound
authorRichard Biener <rguenther@suse.de>
Fri, 3 Apr 2020 11:46:49 +0000 (13:46 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 3 Apr 2020 13:24:11 +0000 (15:24 +0200)
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.

gcc/ChangeLog
gcc/tree.c

index 11510ac941141277c31f08e0905ff10f29040f98..540cf1b41db504d3dfd9c173413c15294383fce8 100644 (file)
@@ -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
index 63dc6730b2b637182aa3476aa0738d682f7b8102..0fe3afce1b6332999577f65452676011b1f282f8 100644 (file)
@@ -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