public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: YunQiang Su <wzssyqa@gmail.com>
To: Jovan Dmitrovic <Jovan.Dmitrovic@syrmia.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	 Djordje Todorovic <Djordje.Todorovic@syrmia.com>
Subject: Re: [PATCH v2] mips: Fix overaligned function arguments [PR109435]
Date: Thu, 29 Jun 2023 18:04:13 +0800	[thread overview]
Message-ID: <CAKcpw6X8JXbVrZHNth1Wj=hPqHfeWHFs-ih31V41G7PN4CjU4w@mail.gmail.com> (raw)
In-Reply-To: <CAKcpw6WMX5REA5okjtie4jc1Ovuzxgxk8QbNdB4yzDYrnf0Pqg@mail.gmail.com>

YunQiang Su <wzssyqa@gmail.com> 于2023年6月29日周四 14:04写道:
>
> Jovan Dmitrovic <Jovan.Dmitrovic@syrmia.com> 于2023年6月27日周二 16:54写道:
> >
> > Hi,
> > I am sending a revised patch, now with different tests for N64/N32 and O32 ABIs.
> > For the O32 ABI, I've skipped the -O0 and -Os pipelines, considering there is a
> > difference between exact offsets for store instructions (the registers used remain
> > the same).
> >
> > Skipping -flto isn't really necessary, so I've removed that part.
> >
> > I've fixed the Changelog, hopefully I've corrected the mistakes I made.
> >
>
> Looks good.
> I will submit this patch with some format improvement.
>

Ohh, my fault: the `-flto` option should always be skipped, when run test.
And you skipped -O0 test on O32, while this bug effects O0 only, it
should not be expected.

The below is my modification to your patch.
Is it OK for you?

--- xx.patch 2023-06-29 14:32:59.805474033 +0800
+++ build/0001-mips-Fix-overaligned-function-arguments-PR109435.patch
2023-06-29 18:01:19.245478275 +0800
@@ -1,4 +1,4 @@
-From 05e4ff4d2fbb91ea8040fb10d8d6a130ad24bba7 Mon Sep 17 00:00:00 2001
+From 7b5af22bb7c8fadce27e94c37c96101a06acd286 Mon Sep 17 00:00:00 2001
 From: Jovan Dmitrovic <Jovan.Dmitrovic@Syrmia.com>
 Date: Mon, 26 Jun 2023 17:00:20 +0200
 Subject: [PATCH] mips: Fix overaligned function arguments [PR109435]
@@ -16,12 +16,13 @@
 2023-06-27  Jovan Dmitrović  <jovan.dmitrovic@syrmia.com>

 gcc/ChangeLog:
-        PR target/109435
+
+ PR target/109435
  * config/mips/mips.cc (mips_function_arg_alignment): Returns
-    the alignment of function argument. In case of typedef type,
-    it returns the aligment of the aliased type.
+ the alignment of function argument. In case of typedef type,
+ it returns the aligment of the aliased type.
  (mips_function_arg_boundary): Relocated calculation of the
-    aligment of function arguments.
+ aligment of function arguments.

 gcc/testsuite/ChangeLog:

@@ -29,9 +30,9 @@
  * gcc.target/mips/align-1-o32.c: New test.
 ---
  gcc/config/mips/mips.cc                     | 19 ++++++++++++++++++-
- gcc/testsuite/gcc.target/mips/align-1-n64.c | 19 +++++++++++++++++++
+ gcc/testsuite/gcc.target/mips/align-1-n64.c | 20 ++++++++++++++++++++
  gcc/testsuite/gcc.target/mips/align-1-o32.c | 20 ++++++++++++++++++++
- 3 files changed, 57 insertions(+), 1 deletion(-)
+ 3 files changed, 58 insertions(+), 1 deletion(-)
  create mode 100644 gcc/testsuite/gcc.target/mips/align-1-n64.c
  create mode 100644 gcc/testsuite/gcc.target/mips/align-1-o32.c

@@ -75,14 +76,15 @@
    if (alignment > STACK_BOUNDARY)
 diff --git a/gcc/testsuite/gcc.target/mips/align-1-n64.c
b/gcc/testsuite/gcc.target/mips/align-1-n64.c
 new file mode 100644
-index 00000000000..46e718d548d
+index 00000000000..3ede539c3a4
 --- /dev/null
 +++ b/gcc/testsuite/gcc.target/mips/align-1-n64.c
-@@ -0,0 +1,19 @@
+@@ -0,0 +1,20 @@
 +/* Check that typedef alignment does not affect passing of function
 +   parameters for N64/N32 ABIs.  */
 +/* { dg-do compile { target { "mips*-*-*" } } } */
 +/* { dg-options "-mabi=64"  } */
++/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
 +
 +typedef struct ui8
 +{
@@ -100,7 +102,7 @@
 +/* { dg-final { scan-assembler "\tsd\t\\\$7,16\\(\\\$\[0-9\]\\)" } } */
 diff --git a/gcc/testsuite/gcc.target/mips/align-1-o32.c
b/gcc/testsuite/gcc.target/mips/align-1-o32.c
 new file mode 100644
-index 00000000000..a548632b7f6
+index 00000000000..e043d6a3eca
 --- /dev/null
 +++ b/gcc/testsuite/gcc.target/mips/align-1-o32.c
 @@ -0,0 +1,20 @@
@@ -108,7 +110,7 @@
 +   parameters for O32 ABI.  */
 +/* { dg-do compile { target { "mips*-*-*" } } } */
 +/* { dg-options "-mabi=32"  } */
-+/* { dg-skip-if "" { *-*-* } { "-O0" "-Os" } { "" } } */
++/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
 +
 +typedef struct ui8
 +{
@@ -121,10 +123,9 @@
 +  return a.v[0];
 +}
 +
-+/* { dg-final { scan-assembler "\tsw\t\\\$5,100\\(\\\$sp\\)" } } */
-+/* { dg-final { scan-assembler "\tsw\t\\\$6,104\\(\\\$sp\\)" } } */
-+/* { dg-final { scan-assembler "\tsw\t\\\$7,108\\(\\\$sp\\)" } } */
++/* { dg-final { scan-assembler "\tsw\t\\\$5,1\\d\\d\\(\\\$(sp|fp)\\)" } } */
++/* { dg-final { scan-assembler "\tsw\t\\\$6,1\\d\\d\\(\\\$(sp|fp)\\)" } } */
++/* { dg-final { scan-assembler "\tsw\t\\\$7,1\\d\\d\\(\\\$(sp|fp)\\)" } } */
 --
-2.34.1
-
+2.30.2


> > Regards,
> > Jovan
>
>
>
> --
> YunQiang Su



-- 
YunQiang Su

  reply	other threads:[~2023-06-29 10:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 10:32 [PATCH] " Jovan Dmitrovic
2023-05-31 10:05 ` YunQiang Su
2023-06-06 10:29   ` Jovan Dmitrovic
2023-06-06 10:50     ` YunQiang Su
2023-06-07 10:28       ` Jovan Dmitrovic
2023-06-16  8:07         ` YunQiang Su
2023-06-27  8:54           ` [PATCH v2] " Jovan Dmitrovic
2023-06-29  6:04             ` YunQiang Su
2023-06-29 10:04               ` YunQiang Su [this message]
2023-06-29 10:46                 ` Jovan Dmitrovic

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='CAKcpw6X8JXbVrZHNth1Wj=hPqHfeWHFs-ih31V41G7PN4CjU4w@mail.gmail.com' \
    --to=wzssyqa@gmail.com \
    --cc=Djordje.Todorovic@syrmia.com \
    --cc=Jovan.Dmitrovic@syrmia.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).