On Mon, Nov 24, 2025 at 8:43 AM Eric Botcazou <[email protected]> wrote:
>
> Hi,
>
> This fixes an old issue whereby we generate wrong code in Ada for an indexed
> component in an array with a ludicrously large index type instead of raising
> Storage_Error.  We would probably need the counterpart of int_const_binop for
> unop in the general case, but that's not worth the hassle so int_const_convert
> is good enough.
>
> Tested on x86-64/Linux, OK for the mainline?

OK.

Richard.

>
> 2025-11-24  Eric Botcazou  <[email protected]>
>
>         PR ada/33994
>         * fold-const.h (int_const_convert): New prototype.
>         * fold-const.cc (fold_convert_const_int_from_int): Rename to...
>         (int_const_convert): ...this, remove static keyword and add third
>         parameter OVERFLOWABLE.
>         (fold_convert_const): Call int_const_convert if ARG1 is an integer
>         constant.
>
>
> 2025-11-24  Eric Botcazou  <[email protected]>
>
>         PR ada/33994
>         * gcc-interface/utils.cc (convert) <INTEGER_TYPE>: Call
>         int_const_convert if the expression is an integer constant.
>
>
> 2025-11-24  Eric Botcazou  <[email protected]>
>
>         * gnat.dg/object_overflow6.adb: New test.
>
> --
> Eric Botcazou

Reply via email to