From: Vladimir Makarov <vmakarov@redhat.com>
To: Alexandre Oliva <oliva@adacore.com>, gcc-patches@gcc.gnu.org
Cc: ebotcazou@libertysurf.fr, segher@kernel.crashing.org, dje.gcc@gmail.com
Subject: Re: [PATCH] [PR100106] Reject unaligned subregs when strict alignment is required
Date: Fri, 6 May 2022 14:04:35 -0400 [thread overview]
Message-ID: <4a642b0d-a15e-cf33-6668-583b84b6ec23@redhat.com> (raw)
In-Reply-To: <or1qx8h3ou.fsf@lxoliva.fsfla.org>
On 2022-05-05 02:52, Alexandre Oliva wrote:
>
> Regstrapped on x86_64-linux-gnu and ppc64le-linux-gnu, also tested
> targeting ppc- and ppc64-vx7r2. Ok to install?
>
I am ok with the modified version of the patch. It looks reasonable for
me and I support its commit.
But I think I can not approve the patch formally as emit-rtl.cc is out
of my jurisdiction and validate_subreg is used in many places besides RA.
Sorry, Alex, some global reviewer should do this.
> for gcc/ChangeLog
>
> PR target/100106
> * emit-rtl.c (validate_subreg): Reject a SUBREG of a MEM that
> requires stricter alignment than MEM's.
>
> for gcc/testsuite/ChangeLog
>
> PR target/100106
> * gcc.target/powerpc/pr100106-sa.c: New.
> ---
> gcc/emit-rtl.cc | 3 +++
> gcc/testsuite/gcc.target/powerpc/pr100106-sa.c | 4 ++++
> 2 files changed, 7 insertions(+)
> create mode 100644 gcc/testsuite/gcc.target/powerpc/pr100106-sa.c
>
> diff --git a/gcc/emit-rtl.cc b/gcc/emit-rtl.cc
> index 1e02ae254d012..642e47eada0d7 100644
> --- a/gcc/emit-rtl.cc
> +++ b/gcc/emit-rtl.cc
> @@ -982,6 +982,9 @@ validate_subreg (machine_mode omode, machine_mode imode,
>
> return subreg_offset_representable_p (regno, imode, offset, omode);
> }
> + else if (reg && MEM_P (reg)
> + && STRICT_ALIGNMENT && MEM_ALIGN (reg) < GET_MODE_ALIGNMENT (omode))
> + return false;
>
> /* The outer size must be ordered wrt the register size, otherwise
> we wouldn't know at compile time how many registers the outer
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr100106-sa.c b/gcc/testsuite/gcc.target/powerpc/pr100106-sa.c
> new file mode 100644
> index 0000000000000..6cc29595c8b25
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/powerpc/pr100106-sa.c
> @@ -0,0 +1,4 @@
> +/* { dg-do compile { target { ilp32 } } } */
> +/* { dg-options "-mcpu=604 -O -mstrict-align" } */
> +
> +#include "../../gcc.c-torture/compile/pr100106.c"
>
>
prev parent reply other threads:[~2022-05-06 18:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-05 6:52 Alexandre Oliva
2022-05-05 7:59 ` Richard Sandiford
2022-05-05 13:50 ` Segher Boessenkool
2022-05-06 10:57 ` [PATCH v2 2/2] " Alexandre Oliva
2022-05-09 8:09 ` Richard Sandiford
2022-05-05 14:33 ` [PATCH] " Segher Boessenkool
2022-05-06 2:41 ` [PATCH v2] " Alexandre Oliva
2022-07-09 17:14 ` Jeff Law
2023-05-24 5:39 ` Alexandre Oliva
2023-05-24 9:04 ` Richard Biener
2022-05-06 18:04 ` Vladimir Makarov [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=4a642b0d-a15e-cf33-6668-583b84b6ec23@redhat.com \
--to=vmakarov@redhat.com \
--cc=dje.gcc@gmail.com \
--cc=ebotcazou@libertysurf.fr \
--cc=gcc-patches@gcc.gnu.org \
--cc=oliva@adacore.com \
--cc=segher@kernel.crashing.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).