https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64055
--- Comment #6 from Ilya Enkovich <enkovich.gnu at gmail dot com> --- TREE_INT_CST_LOW (maxval) assumes integer constant anyway. Therefore we may use simpler check. It fixes gnat.dg/derived_aggregate.adb. diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c index 0fb78cc..84886da 100644 --- a/gcc/tree-chkp.c +++ b/gcc/tree-chkp.c @@ -1568,7 +1568,9 @@ chkp_find_bound_slots_1 (const_tree type, bitmap have_bound, HOST_WIDE_INT esize = TREE_INT_CST_LOW (TYPE_SIZE (etype)); unsigned HOST_WIDE_INT cur; - if (!maxval || integer_minus_onep (maxval)) + if (!maxval + || TREE_CODE (maxval) != INTEGER_CST + || integer_minus_onep (maxval)) return; for (cur = 0; cur <= TREE_INT_CST_LOW (maxval); cur++)