On Thu, Jun 26, 2025 at 12:34 PM Eric Botcazou <botca...@adacore.com> wrote:
>
> Hi,
>
> fold_ctor_reference already punts on a CONSTRUCTOR whose type has reverse
> storage order, but it can be invoked in a couple of places on a CONSTRUCTOR
> with native storage order that has been wrapped in a VIEW_CONVERT_EXPR to a
> type with reverse storage order; this would require a post adjustment that
> does not currently exist, thus yield wrong code for this admittedly quite
> pathological (but supported) case.
>
> Technically, this is a regression in GCC 10.x and later but, being quite
> pathological, at least in Ada, I don't think that we need to bother about it
> on earlier branches than gcc-13.
>
> Tested on x86-64/Linux, OK for mainline down to the gcc-13 branch?

OK.

Thanks,
Richard.

>
> 2025-06-26  Eric Botcazou  <ebotca...@adacore.com>
>
>         * gimple-fold.cc (fold_const_aggregate_ref_1) <COMPONENT_REF>:
>         Bail out immediately if the reference has reverse storage order.
>         * tree-ssa-sccvn.cc (fully_constant_vn_reference_p): Likewise.
>
>
> 2025-06-26  Eric Botcazou  <ebotca...@adacore.com>
>
>         * gnat.dg/sso20.adb: New test.
>
> --
> Eric Botcazou

Reply via email to