public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Eric Botcazou <botcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Fix couple of endianness issues in fold_ctor_reference
Date: Fri, 30 Jun 2023 12:09:17 +0200	[thread overview]
Message-ID: <CAFiYyc0yVQSWPtCVx9e5yeoT66XL34A=qGmK2pT27oQYkx7fhw@mail.gmail.com> (raw)
In-Reply-To: <10296585.nUPlyArG6x@fomalhaut>

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  <ebotcazou@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  <ebotcazou@adacore.com>
>
>         * gcc.c-torture/execute/20230630-1.c: New test.
>         * gcc.c-torture/execute/20230630-2.c: Likewise.
>
> --
> Eric Botcazou

      reply	other threads:[~2023-06-30 10:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30  9:28 Eric Botcazou
2023-06-30 10:09 ` Richard Biener [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFiYyc0yVQSWPtCVx9e5yeoT66XL34A=qGmK2pT27oQYkx7fhw@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=botcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).