Hi Alexander, > -----Original Message----- > From: Alexandre Oliva <[email protected]> > Sent: Saturday, September 13, 2025 8:02 AM > To: [email protected] > Cc: Vladimir Makarov <[email protected]>; Rainer Orth <[email protected] > Bielefeld.DE>; Mike Stump <[email protected]>; Richard Earnshaw > <[email protected]>; Tamar Christina <[email protected]>; > Kyrylo Tkachov <[email protected]> > Subject: [PATCH 1v1/2] [aarch64] [testsuite] accept ldr after failed ira-remat > > > When -fPIE is enabled (by default), nonlocal_goto tests fail because > ira drops reg equivalences for function invariants such as stack > addresses, and then, instead of the expected add instructions, we get > ldr to restore the pseudo holding the address, as it ends up living in > a stack slot across a call. > > Tested o aarch64-linux-gnu with --enable-default-pie. Ok to install? >
I have a slight preference for this one so we still see if the PIE codegen changes. So OK. Thanks, Tamar > > for gcc/testsuite/ChangeLog > > * gcc.target/aarch64/sme/nonlocal_goto_1.c: Accept ldr. > * gcc.target/aarch64/sme/nonlocal_goto_2.c: Likewise. > * gcc.target/aarch64/sme/nonlocal_goto_3.c: Likewise. > --- > .../gcc.target/aarch64/sme/nonlocal_goto_1.c | 2 +- > .../gcc.target/aarch64/sme/nonlocal_goto_2.c | 2 +- > .../gcc.target/aarch64/sme/nonlocal_goto_3.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_1.c > b/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_1.c > index 11578279b9287..de9702e744519 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_1.c > +++ b/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_1.c > @@ -17,7 +17,7 @@ void run(void (*)()); > ** ldr x16, \1 > ** tbz x16, 0, .* > ** smstart sm > -** add x0, .* > +** (add|ldr) x0, .* > ** ldr x16, \1 > ** tbz x16, 0, .* > ** smstop sm > diff --git a/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_2.c > b/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_2.c > index 37dbcbae1a4f8..598db3cad38dd 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_2.c > +++ b/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_2.c > @@ -9,7 +9,7 @@ void run(void (*)()); > ** smstop sm > ** bl [^\n]*[cC]ache[^\n]* > ** smstart sm > -** add x0, .* > +** (add|ldr) x0, .* > ** smstop sm > ** bl run > ** smstart sm > diff --git a/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_3.c > b/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_3.c > index ae661653f3028..9aedd088d7807 100644 > --- a/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_3.c > +++ b/gcc/testsuite/gcc.target/aarch64/sme/nonlocal_goto_3.c > @@ -11,7 +11,7 @@ void run(void (*)()); > ** smstop sm > ** bl [^\n]*[cC]ache[^\n]* > ** smstart sm > -** add x0, .* > +** (add|ldr) x0, .* > ** smstop sm > ** bl run > ** smstart sm > > -- > Alexandre Oliva, happy hacker https://blog.lx.oliva.nom.br/ > Free Software Activist FSFLA co-founder GNU Toolchain Engineer > More tolerance and less prejudice are key for inclusion and diversity. > Excluding neuro-others for not behaving ""normal"" is *not* inclusive!
