public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] LoongArch: testsuite: Disable stack protector for got-load.C
@ 2024-01-23 11:35 Xi Ruoyao
  2024-01-23 12:53 ` chenglulu
  0 siblings, 1 reply; 2+ messages in thread
From: Xi Ruoyao @ 2024-01-23 11:35 UTC (permalink / raw)
  To: gcc-patches; +Cc: chenglulu, i, xuchenghua, Xi Ruoyao

When building GCC with --enable-default-ssp, the stack protector is
enabled for got-load.C, causing additional GOT loads for
__stack_chk_guard.  So mem/u will be matched more than 2 times and the
test will fail.

Disable stack protector to fix this issue.

gcc/testsuite:

	* g++.target/loongarch/got-load.C (dg-options): Add
	-fno-stack-protector.
---

Ok for trunk?

 gcc/testsuite/g++.target/loongarch/got-load.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.target/loongarch/got-load.C b/gcc/testsuite/g++.target/loongarch/got-load.C
index 20924c73942..17870176ab4 100644
--- a/gcc/testsuite/g++.target/loongarch/got-load.C
+++ b/gcc/testsuite/g++.target/loongarch/got-load.C
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-mabi=lp64d -O2 -mexplicit-relocs -mcmodel=normal -fdump-rtl-expand" } */
+/* { dg-options "-mabi=lp64d -O2 -mexplicit-relocs -mcmodel=normal -fdump-rtl-expand -fno-stack-protector" } */
 /* { dg-final { scan-rtl-dump-times "mem/u" 2 "expand" } } */
 
 #include <bits/stdc++.h>
-- 
2.43.0


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

* Re: [PATCH] LoongArch: testsuite: Disable stack protector for got-load.C
  2024-01-23 11:35 [PATCH] LoongArch: testsuite: Disable stack protector for got-load.C Xi Ruoyao
@ 2024-01-23 12:53 ` chenglulu
  0 siblings, 0 replies; 2+ messages in thread
From: chenglulu @ 2024-01-23 12:53 UTC (permalink / raw)
  To: Xi Ruoyao, gcc-patches; +Cc: i, xuchenghua

LGTM!

Thanks!

在 2024/1/23 下午7:35, Xi Ruoyao 写道:
> When building GCC with --enable-default-ssp, the stack protector is
> enabled for got-load.C, causing additional GOT loads for
> __stack_chk_guard.  So mem/u will be matched more than 2 times and the
> test will fail.
>
> Disable stack protector to fix this issue.
>
> gcc/testsuite:
>
> 	* g++.target/loongarch/got-load.C (dg-options): Add
> 	-fno-stack-protector.
> ---
>
> Ok for trunk?
>
>   gcc/testsuite/g++.target/loongarch/got-load.C | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/testsuite/g++.target/loongarch/got-load.C b/gcc/testsuite/g++.target/loongarch/got-load.C
> index 20924c73942..17870176ab4 100644
> --- a/gcc/testsuite/g++.target/loongarch/got-load.C
> +++ b/gcc/testsuite/g++.target/loongarch/got-load.C
> @@ -1,5 +1,5 @@
>   /* { dg-do compile } */
> -/* { dg-options "-mabi=lp64d -O2 -mexplicit-relocs -mcmodel=normal -fdump-rtl-expand" } */
> +/* { dg-options "-mabi=lp64d -O2 -mexplicit-relocs -mcmodel=normal -fdump-rtl-expand -fno-stack-protector" } */
>   /* { dg-final { scan-rtl-dump-times "mem/u" 2 "expand" } } */
>   
>   #include <bits/stdc++.h>


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

end of thread, other threads:[~2024-01-23 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-23 11:35 [PATCH] LoongArch: testsuite: Disable stack protector for got-load.C Xi Ruoyao
2024-01-23 12:53 ` chenglulu

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