From: Richard Biener Date: Wed, 20 Oct 2021 10:54:59 +0000 (+0200) Subject: tree-optimization/102853 - avoid trapping types in split_constant_offset X-Git-Tag: basepoints/gcc-13~3755 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac5e46563817f4f1bd786be1d21b85d18e61bc0c;p=thirdparty%2Fgcc.git tree-optimization/102853 - avoid trapping types in split_constant_offset 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 PR tree-optimization/102853 * tree-data-ref.c (split_constant_offset_1): Bail out immediately if the expression traps on overflow. --- diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 57bac06242fa..46f4ffedb483 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -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: