On Thu, Mar 18, 2021 at 1:04 PM Eric Botcazou <botca...@adacore.com> wrote:
>
> Hi,
>
> this is the failure of a couple of tests in the gnat.dg testsuite on 32-bit
> platforms (but on some hosts only):
>
> FAIL: gnat.dg/loop_optimization3.adb (test for excess errors)
> FAIL: gnat.dg/opt30.adb (test for excess errors)
> FAIL: gnat.dg/opt49.adb (test for excess errors)
>
> caused by a segfault in native_encode_initializer when it is encoding the
> CONSTRUCTOR for an array whose lower bound is negative (it's OK in Ada).
> The computation of the current position is done in HOST_WIDE_INT and this does
> not work for arrays whose original range has a negative lower bound and a
> positive upper bound; the computation must be done in sizetype instead so that
> it may wrap around, like in get_inner_reference or get_ref_base_and_extent.
>
> Tested on x86-64/Linux, OK for the mainline and 10 branch?

Can you use wide_ints instead of building trees here please?

Thanks,
Richard.

>
>
> 2021-03-18  Eric Botcazou  <ebotca...@adacore.com>
>
>         PR middle-end/99641
>         * fold-const.c (native_encode_initializer) <CONSTRUCTOR>: For an
>         array type, do the computation of the current position in sizetype.
>
> --
> Eric Botcazou

Reply via email to