On Fri, Jun 30, 2023 at 11:29 AM Eric Botcazou via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Hi,
>
> fold_ctor_reference attempts to use a recursive local processing in order to
> call native_encode_expr on the leaf nodes of the constructor, before falling
> back to calling native_encode_initializer if this fails.  There are a couple
> of issues related to endianness present in it:
>   1) it does not specifically handle integral bit-fields; now these are left
> justified on big-endian platforms so cannot be treated like ordinary fields.
>   2) it does not check that the constructor uses the native storage order.
>
> Proposed fix attached, tested on x86-64/Linux and SPARC/Solaris, OK for the
> mainline and some branches?

OK.

thanks,
Richard.

>
> 2023-06-30  Eric Botcazou  <ebotca...@adacore.com>
>
>         * gimple-fold.cc (fold_array_ctor_reference): Fix head comment.
>         (fold_nonarray_ctor_reference): Likewise.  Specifically deal
>         with integral bit-fields.
>         (fold_ctor_reference): Check that the constructor uses the
>         native storage order.
>
>
> 2023-06-30  Eric Botcazou  <ebotca...@adacore.com>
>
>         * gcc.c-torture/execute/20230630-1.c: New test.
>         * gcc.c-torture/execute/20230630-2.c: Likewise.
>
> --
> Eric Botcazou

Reply via email to