public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* add explicit ABI and align options to pr88233.c
@ 2021-03-10 11:00 Alexandre Oliva
  2024-04-22  9:38 ` [PATCH v2] " Alexandre Oliva
  0 siblings, 1 reply; 6+ messages in thread
From: Alexandre Oliva @ 2021-03-10 11:00 UTC (permalink / raw)
  To: gcc-patches; +Cc: Rainer Orth, Mike Stump, Segher Boessenkool, David Edelsohn


We've observed failures of this test on powerpc configurations that
default to different calling conventions and alignment requirements.
Both settings are needed for the expectations to be met.

This was regstrapped on x86_64-linux-gnu and ppc64-linux-gnu, and tested
with a cross to a ppc64-vxworks7r2 with both -mstrict-align and
-freg-struct-return enabled by default.  Ok to install?


for  gcc/testsuite/ChangeLog

	* gcc.target/powerpc/pr88233.c: Make some alignment strictness
	and calling conventions assumptions explicit.
---
 gcc/testsuite/gcc.target/powerpc/pr88233.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/pr88233.c b/gcc/testsuite/gcc.target/powerpc/pr88233.c
index 27c73717a3f79..c667a28ebfedf 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr88233.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr88233.c
@@ -1,5 +1,5 @@
 /* { dg-require-effective-target lp64 } */
-/* { dg-options "-O2 -mdejagnu-cpu=power8" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power8 -mno-strict-align -fno-reg-struct-return" } */
 
 typedef struct { double a[2]; } A;
 A

-- 
Alexandre Oliva, happy hacker  https://FSFLA.org/blogs/lxo/
   Free Software Activist         GNU Toolchain Engineer
        Vim, Vi, Voltei pro Emacs -- GNUlius Caesar

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] add explicit ABI and align options to pr88233.c
  2021-03-10 11:00 add explicit ABI and align options to pr88233.c Alexandre Oliva
@ 2024-04-22  9:38 ` Alexandre Oliva
  2024-05-25  8:15   ` Alexandre Oliva
  2024-05-27  2:57   ` Kewen.Lin
  0 siblings, 2 replies; 6+ messages in thread
From: Alexandre Oliva @ 2024-04-22  9:38 UTC (permalink / raw)
  To: gcc-patches
  Cc: Rainer Orth, Mike Stump, David Edelsohn, Segher Boessenkool, Kewen Lin

Ping?
https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566530.html
(modified version follows)


We've observed failures of this test on powerpc configurations that
default to different calling conventions and alignment requirements.
Both settings are needed for the original expectations to be met.

The test was later modified to have different expectations for big and
little endian code generation.  This patch restores the original
codegen expectations, that, with the explicit options, don't vary any
more.

Regstrapped on x86_64-linux-gnu and ppc64el-linux-gnu.  Also tested with
gcc-13 on ppc64-vx7r2 and ppc-vx7r2.  Ok to install?


for  gcc/testsuite/ChangeLog

	* gcc.target/powerpc/pr88233.c: Make some alignment strictness
	and calling conventions assumptions explicit.  Restore uniform
	codegen expectations
---
 gcc/testsuite/gcc.target/powerpc/pr88233.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.target/powerpc/pr88233.c b/gcc/testsuite/gcc.target/powerpc/pr88233.c
index 27c73717a3f79..46a3ebfa28775 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr88233.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr88233.c
@@ -1,5 +1,5 @@
 /* { dg-require-effective-target lp64 } */
-/* { dg-options "-O2 -mdejagnu-cpu=power8" } */
+/* { dg-options "-O2 -mdejagnu-cpu=power8 -mno-strict-align -fpcc-struct-return" } */
 
 typedef struct { double a[2]; } A;
 A
@@ -9,6 +9,5 @@ foo (const A *a)
 }
 
 /* { dg-final { scan-assembler-not {\mmtvsr} } } */
-/* { dg-final { scan-assembler-times {\mlxvd2x\M} 1 { target { be } } } } */
-/* { dg-final { scan-assembler-times {\mstxvd2x\M} 1 { target { be } } } } */
-/* { dg-final { scan-assembler-times {\mlfd\M} 2 { target { le } } } } */
+/* { dg-final { scan-assembler-times {\mlxvd2x\M} 1 } } */
+/* { dg-final { scan-assembler-times {\mstxvd2x\M} 1 } } */


-- 
Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
   Free Software Activist                   GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity
Excluding neuro-others for not behaving ""normal"" is *not* inclusive

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] add explicit ABI and align options to pr88233.c
  2024-04-22  9:38 ` [PATCH v2] " Alexandre Oliva
@ 2024-05-25  8:15   ` Alexandre Oliva
  2024-05-27  2:57   ` Kewen.Lin
  1 sibling, 0 replies; 6+ messages in thread
From: Alexandre Oliva @ 2024-05-25  8:15 UTC (permalink / raw)
  To: gcc-patches
  Cc: Rainer Orth, Mike Stump, David Edelsohn, Segher Boessenkool, Kewen Lin

On Apr 22, 2024, Alexandre Oliva <oliva@adacore.com> wrote:

> for  gcc/testsuite/ChangeLog

> 	* gcc.target/powerpc/pr88233.c: Make some alignment strictness
> 	and calling conventions assumptions explicit.  Restore uniform
> 	codegen expectations

Ping?  https://gcc.gnu.org/pipermail/gcc-patches/2024-April/649823.html

-- 
Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
   Free Software Activist                   GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity
Excluding neuro-others for not behaving ""normal"" is *not* inclusive

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] add explicit ABI and align options to pr88233.c
  2024-04-22  9:38 ` [PATCH v2] " Alexandre Oliva
  2024-05-25  8:15   ` Alexandre Oliva
@ 2024-05-27  2:57   ` Kewen.Lin
  2024-05-29  6:32     ` Alexandre Oliva
  1 sibling, 1 reply; 6+ messages in thread
From: Kewen.Lin @ 2024-05-27  2:57 UTC (permalink / raw)
  To: Alexandre Oliva
  Cc: Rainer Orth, Mike Stump, David Edelsohn, Segher Boessenkool,
	Kewen Lin, gcc-patches

Hi,

on 2024/4/22 17:38, Alexandre Oliva wrote:
> Ping?
> https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566530.html
> (modified version follows)

Segher originated this test case, I was expecting he can chime in this. :)

> 
> 
> We've observed failures of this test on powerpc configurations that
> default to different calling conventions and alignment requirements.

It seems that it was using the original "BE" and "LE" guards to shadow
ABIs, could you share some more on how you found this failure?  It seems
that your test environment with -mstrict-align turned on by default?  And
also having a ABI which passing small struct return value in register?

BR,
Kewen


> Both settings are needed for the original expectations to be met.
> 
> The test was later modified to have different expectations for big and
> little endian code generation.  This patch restores the original
> codegen expectations, that, with the explicit options, don't vary any
> more.
> 
> Regstrapped on x86_64-linux-gnu and ppc64el-linux-gnu.  Also tested with
> gcc-13 on ppc64-vx7r2 and ppc-vx7r2.  Ok to install?
> 
> 
> for  gcc/testsuite/ChangeLog
> 
> 	* gcc.target/powerpc/pr88233.c: Make some alignment strictness
> 	and calling conventions assumptions explicit.  Restore uniform
> 	codegen expectations
> ---
>  gcc/testsuite/gcc.target/powerpc/pr88233.c |    7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/gcc/testsuite/gcc.target/powerpc/pr88233.c b/gcc/testsuite/gcc.target/powerpc/pr88233.c
> index 27c73717a3f79..46a3ebfa28775 100644
> --- a/gcc/testsuite/gcc.target/powerpc/pr88233.c
> +++ b/gcc/testsuite/gcc.target/powerpc/pr88233.c
> @@ -1,5 +1,5 @@
>  /* { dg-require-effective-target lp64 } */
> -/* { dg-options "-O2 -mdejagnu-cpu=power8" } */
> +/* { dg-options "-O2 -mdejagnu-cpu=power8 -mno-strict-align -fpcc-struct-return" } */
>  
>  typedef struct { double a[2]; } A;
>  A
> @@ -9,6 +9,5 @@ foo (const A *a)
>  }
>  
>  /* { dg-final { scan-assembler-not {\mmtvsr} } } */
> -/* { dg-final { scan-assembler-times {\mlxvd2x\M} 1 { target { be } } } } */
> -/* { dg-final { scan-assembler-times {\mstxvd2x\M} 1 { target { be } } } } */
> -/* { dg-final { scan-assembler-times {\mlfd\M} 2 { target { le } } } } */
> +/* { dg-final { scan-assembler-times {\mlxvd2x\M} 1 } } */
> +/* { dg-final { scan-assembler-times {\mstxvd2x\M} 1 } } */
> 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] add explicit ABI and align options to pr88233.c
  2024-05-27  2:57   ` Kewen.Lin
@ 2024-05-29  6:32     ` Alexandre Oliva
  2024-05-31  6:59       ` Kewen.Lin
  0 siblings, 1 reply; 6+ messages in thread
From: Alexandre Oliva @ 2024-05-29  6:32 UTC (permalink / raw)
  To: Kewen.Lin
  Cc: Rainer Orth, Mike Stump, David Edelsohn, Segher Boessenkool,
	Kewen Lin, gcc-patches

On May 26, 2024, "Kewen.Lin" <linkw@linux.ibm.com> wrote:

> Hi,
> on 2024/4/22 17:38, Alexandre Oliva wrote:
>> Ping?
>> https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566530.html
>> (modified version follows)

> Segher originated this test case, I was expecting he can chime in this. :)

Me too ;-)

>> We've observed failures of this test on powerpc configurations that
>> default to different calling conventions and alignment requirements.

> It seems that it was using the original "BE" and "LE" guards to shadow
> ABIs, could you share some more on how you found this failure?  It seems
> that your test environment with -mstrict-align turned on by default?  And
> also having a ABI which passing small struct return value in register?

Exactly, AdaCore's ppc64-vx7r2 are configured so as to enable
-mstrict-align and -freg-struct-return by default.

But since these settings may change depending on the target variant, I
figured it would be useful to record what the assumptions are that the
test makes.  That one of these settings changed depending on endianness
and affected codegen was, to me, further evidence that this would be
useful, so, with the explicit settings, I could restore the original
test's expectations.

-- 
Alexandre Oliva, happy hacker            https://FSFLA.org/blogs/lxo/
   Free Software Activist                   GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity
Excluding neuro-others for not behaving ""normal"" is *not* inclusive

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] add explicit ABI and align options to pr88233.c
  2024-05-29  6:32     ` Alexandre Oliva
@ 2024-05-31  6:59       ` Kewen.Lin
  0 siblings, 0 replies; 6+ messages in thread
From: Kewen.Lin @ 2024-05-31  6:59 UTC (permalink / raw)
  To: Alexandre Oliva
  Cc: Rainer Orth, Mike Stump, David Edelsohn, Segher Boessenkool,
	Kewen Lin, gcc-patches

on 2024/5/29 14:32, Alexandre Oliva wrote:
> On May 26, 2024, "Kewen.Lin" <linkw@linux.ibm.com> wrote:
> 
>> Hi,
>> on 2024/4/22 17:38, Alexandre Oliva wrote:
>>> Ping?
>>> https://gcc.gnu.org/pipermail/gcc-patches/2021-March/566530.html
>>> (modified version follows)
> 
>> Segher originated this test case, I was expecting he can chime in this. :)
> 
> Me too ;-)
> 
>>> We've observed failures of this test on powerpc configurations that
>>> default to different calling conventions and alignment requirements.
> 
>> It seems that it was using the original "BE" and "LE" guards to shadow
>> ABIs, could you share some more on how you found this failure?  It seems
>> that your test environment with -mstrict-align turned on by default?  And
>> also having a ABI which passing small struct return value in register?
> 
> Exactly, AdaCore's ppc64-vx7r2 are configured so as to enable
> -mstrict-align and -freg-struct-return by default.

OK, thanks for the information!

> 
> But since these settings may change depending on the target variant, I
> figured it would be useful to record what the assumptions are that the
> test makes.  That one of these settings changed depending on endianness
> and affected codegen was, to me, further evidence that this would be
> useful, so, with the explicit settings, I could restore the original
> test's expectations.

Got it, but it also means we can probably test it without the default ABI
on the test env, someone may argue this testing is of less value.  By
visiting the original PR, maybe we can drop the scanning on the load isns
and just keep the scanning-not on mtvsr, it becomes not sensitive for the
alignment and struct result passing way.  Looking forward to Segher's
opinion on this patch. :)

BR,
Kewen


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-31  6:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 11:00 add explicit ABI and align options to pr88233.c Alexandre Oliva
2024-04-22  9:38 ` [PATCH v2] " Alexandre Oliva
2024-05-25  8:15   ` Alexandre Oliva
2024-05-27  2:57   ` Kewen.Lin
2024-05-29  6:32     ` Alexandre Oliva
2024-05-31  6:59       ` Kewen.Lin

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).