https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89119

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
There are only a couple of spots that build this:
constexpr.c:                e.index = build2 (RANGE_EXPR, sizetype, new_lo,
hi);
constexpr.c:      tree range = build2 (RANGE_EXPR, size_type_node,
init.c:     ce.index = build2 (RANGE_EXPR, sizetype, size_zero_node,
init.c:     ce.index = build2 (RANGE_EXPR, sizetype, size_zero_node,
max_index);
init.c:             field = build2 (RANGE_EXPR, sizetype, field,
typeck2.c:              tree range = build2 (RANGE_EXPR, size_type_node,
As you can see, all of them are sizetype or size_type_node and the operands
should be really the same type.  Several of them assert that what they are
building the RANGE_EXPR with is INTEGER_CST, other spots use size_int () or
similar to construct those INTEGER_CSTs.  In any case, RANGE_EXPRs make only
sense with constant ranges, for anything else there should be runtime loop
initializing it, and they are about array indexes, which is something expressed
in sizetype.

Reply via email to