]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/102853 - avoid trapping types in split_constant_offset
authorRichard Biener <rguenther@suse.de>
Wed, 20 Oct 2021 10:54:59 +0000 (12:54 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 20 Oct 2021 11:48:35 +0000 (13:48 +0200)
This avoids running into the assert in compute_distributive_range when
starting the analysis with operations in a trapping type.

2021-10-20  Richard Biener  <rguenther@suse.de>

PR tree-optimization/102853
* tree-data-ref.c (split_constant_offset_1): Bail out
immediately if the expression traps on overflow.

gcc/tree-data-ref.c

index 57bac06242fa6a427bf0390291428eb0cedd1564..46f4ffedb4830dd67ae12f8e36c19db234a88723 100644 (file)
@@ -757,6 +757,9 @@ split_constant_offset_1 (tree type, tree op0, enum tree_code code, tree op1,
   *var = NULL_TREE;
   *off = NULL_TREE;
 
+  if (INTEGRAL_TYPE_P (type) && TYPE_OVERFLOW_TRAPS (type))
+    return false;
+
   switch (code)
     {
     case INTEGER_CST: