On Thu, Dec 07, 2023 at 04:05:47PM +0000, Richard Sandiford wrote:
> Marek Polacek <pola...@redhat.com> writes:
> > Bootstrapped/regtested on aarch64-pc-linux-gnu, ok for trunk/13?
> >
> > -- >8 --
> > These tests fail when the testsuite is executed with 
> > -fstack-protector-strong.
> > To avoid this, this patch adds -fno-stack-protector to dg-options.
> >
> > The list of FAILs is appended.  As you can see, it's mostly about
> > scan-assembler-* which are sort of expected to fail with the stack
> > protector on.
> >
> > FAIL: gcc.target/aarch64/ldp_stp_unaligned_2.c scan-assembler-not 
> > mov\\tx[0-9]+, sp
> > FAIL: gcc.target/aarch64/shadow_call_stack_5.c scan-assembler-times 
> > stp\\\\tx29, x30, \\\\[sp\\\\] 1
> > FAIL: gcc.target/aarch64/shadow_call_stack_5.c scan-assembler ldr\\\\tx29, 
> > \\\\[sp\\\\]
> > FAIL: gcc.target/aarch64/shadow_call_stack_6.c scan-assembler-times 
> > str\\\\tx30, \\\\[sp\\\\] 1
> > FAIL: gcc.target/aarch64/shadow_call_stack_7.c scan-assembler-times 
> > stp\\\\tx19, x30, \\\\[sp, -[0-9]+\\\\]! 1
> > FAIL: gcc.target/aarch64/shadow_call_stack_7.c scan-assembler ldr\\\\tx19, 
> > \\\\[sp\\\\], [0-9]+
> > FAIL: gcc.target/aarch64/shadow_call_stack_8.c scan-assembler-times 
> > stp\\\\tx19, x20, \\\\[sp, -[0-9]+\\\\]! 1
> > FAIL: gcc.target/aarch64/shadow_call_stack_8.c scan-assembler ldp\\\\tx19, 
> > x20, \\\\[sp\\\\], [0-9]+
> > FAIL: gcc.target/aarch64/stack-check-12.c scan-assembler-times str\\\\txzr, 
> >  2
> > FAIL: gcc.target/aarch64/stack-check-prologue-11.c scan-assembler-times 
> > str\\\\s+xzr, \\\\[sp, 1024\\\\] 1
> > FAIL: gcc.target/aarch64/stack-check-prologue-12.c scan-assembler-times 
> > str\\\\s+xzr, \\\\[sp, 1024\\\\] 1
> > FAIL: gcc.target/aarch64/stack-check-prologue-13.c scan-assembler-times 
> > str\\\\s+xzr, \\\\[sp, 1024\\\\] 1
> > FAIL: gcc.target/aarch64/stack-check-prologue-13.c scan-assembler-times 
> > str\\\\s+x30, \\\\[sp\\\\] 1
> > FAIL: gcc.target/aarch64/stack-check-prologue-14.c scan-assembler-times 
> > str\\\\s+xzr, \\\\[sp, 1024\\\\] 1
> > FAIL: gcc.target/aarch64/stack-check-prologue-14.c scan-assembler-times 
> > str\\\\s+x30, \\\\[sp\\\\] 1
> > FAIL: gcc.target/aarch64/stack-check-prologue-15.c scan-assembler-times 
> > str\\\\s+xzr, \\\\[sp, 1024\\\\] 1
> > FAIL: gcc.target/aarch64/stack-check-prologue-15.c scan-assembler-times 
> > str\\\\s+x30, \\\\[sp\\\\] 1
> > FAIL: gcc.target/aarch64/stack-check-prologue-17.c check-function-bodies 
> > test1
> > FAIL: gcc.target/aarch64/stack-check-prologue-17.c check-function-bodies 
> > test2
> > FAIL: gcc.target/aarch64/stack-check-prologue-18.c check-function-bodies 
> > test1
> > FAIL: gcc.target/aarch64/stack-check-prologue-18.c check-function-bodies 
> > test2
> > FAIL: gcc.target/aarch64/stack-check-prologue-18.c check-function-bodies 
> > test3
> > FAIL: gcc.target/aarch64/stack-check-prologue-19.c check-function-bodies 
> > test1
> > FAIL: gcc.target/aarch64/stack-check-prologue-19.c check-function-bodies 
> > test2
> > FAIL: gcc.target/aarch64/stack-check-prologue-19.c check-function-bodies 
> > test3
> > FAIL: gcc.target/aarch64/stack-check-prologue-2.c scan-assembler-times 
> > str\\\\s+xzr, 0
> > FAIL: gcc.target/aarch64/stack-check-prologue-5.c scan-assembler-times 
> > str\\\\s+xzr, \\\\[sp, 1024\\\\] 1
> > FAIL: gcc.target/aarch64/stack-check-prologue-6.c scan-assembler-times 
> > str\\\\s+xzr, \\\\[sp, 1024\\\\] 1
> > FAIL: gcc.target/aarch64/stack-check-prologue-8.c scan-assembler-times 
> > str\\\\s+xzr, \\\\[sp, 1024\\\\] 2
> > FAIL: gcc.target/aarch64/stack-check-prologue-9.c scan-assembler-times 
> > str\\\\s+xzr, \\\\[sp, 1024\\\\] 1
> > FAIL: gcc.target/aarch64/test_frame_1.c scan-assembler-times str\\tx30, 
> > \\\\[sp, -[0-9]+\\\\]! 2
> > FAIL: gcc.target/aarch64/test_frame_10.c scan-assembler-times stp\\tx19, 
> > x30, \\\\[sp, [0-9]+\\\\] 1
> > FAIL: gcc.target/aarch64/test_frame_10.c scan-assembler ldp\\tx19, x30, 
> > \\\\[sp, [0-9]+\\\\]
> > FAIL: gcc.target/aarch64/test_frame_11.c scan-assembler-times stp\\tx29, 
> > x30, \\\\[sp, -[0-9]+\\\\]! 2
> > FAIL: gcc.target/aarch64/test_frame_13.c scan-assembler-times stp\\tx29, 
> > x30, \\\\[sp\\\\] 1
> > FAIL: gcc.target/aarch64/test_frame_15.c scan-assembler-times stp\\tx29, 
> > x30, \\\\[sp, [0-9]+\\\\] 1
> > FAIL: gcc.target/aarch64/test_frame_2.c scan-assembler-times stp\\tx19, 
> > x30, \\\\[sp, -[0-9]+\\\\]! 1
> > FAIL: gcc.target/aarch64/test_frame_2.c scan-assembler ldp\\tx19, x30, 
> > \\\\[sp\\\\], [0-9]+
> > FAIL: gcc.target/aarch64/test_frame_4.c scan-assembler-times stp\\tx19, 
> > x30, \\\\[sp, -[0-9]+\\\\]! 1
> > FAIL: gcc.target/aarch64/test_frame_4.c scan-assembler ldp\\tx19, x30, 
> > \\\\[sp\\\\], [0-9]+
> > FAIL: gcc.target/aarch64/test_frame_6.c scan-assembler-times str\\tx30, 
> > \\\\[sp\\\\] 1
> > FAIL: gcc.target/aarch64/test_frame_7.c scan-assembler-times stp\\tx19, 
> > x30, \\\\[sp] 1
> > FAIL: gcc.target/aarch64/test_frame_8.c scan-assembler-times str\\tx30, 
> > \\\\[sp, [0-9]+\\\\] 1
> > FAIL: gcc.target/aarch64/test_frame_8.c scan-assembler ldr\\tx30, \\\\[sp, 
> > [0-9]+\\\\]
> > FAIL: gcc.target/aarch64/sve/struct_vect_24.c scan-assembler-times 
> > cmp\\\\s+x[0-9]+, 61440 4
> > FAIL: gcc.target/aarch64/sve/struct_vect_24.c scan-assembler-times 
> > sub\\\\s+x[0-9]+, x[0-9]+, 61440 4
> > FAIL: gcc.target/aarch64/sve/struct_vect_24.c scan-assembler-times 
> > cmp\\s+x[0-9]+, 61440 4
> > FAIL: gcc.target/aarch64/sve/struct_vect_24.c scan-assembler-times 
> > sub\\s+x[0-9]+, x[0-9]+, 61440 4
> >
> > gcc/testsuite/ChangeLog:
> >
> >     * gcc.target/aarch64/ldp_stp_unaligned_2.c: Use -fno-stack-protector.
> >     * gcc.target/aarch64/shadow_call_stack_5.c: Likewise.
> >     * gcc.target/aarch64/shadow_call_stack_6.c: Likewise.
> >     * gcc.target/aarch64/shadow_call_stack_7.c: Likewise.
> >     * gcc.target/aarch64/shadow_call_stack_8.c: Likewise.
> >     * gcc.target/aarch64/stack-check-12.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-11.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-12.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-13.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-14.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-15.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-17.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-18.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-19.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-2.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-5.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-6.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-8.c: Likewise.
> >     * gcc.target/aarch64/stack-check-prologue-9.c: Likewise.
> >     * gcc.target/aarch64/sve/struct_vect_24.c: Likewise.
> >     * gcc.target/aarch64/test_frame_1.c: Likewise.
> >     * gcc.target/aarch64/test_frame_10.c: Likewise.
> >     * gcc.target/aarch64/test_frame_11.c: Likewise.
> >     * gcc.target/aarch64/test_frame_13.c: Likewise.
> >     * gcc.target/aarch64/test_frame_15.c: Likewise.
> >     * gcc.target/aarch64/test_frame_2.c: Likewise.
> >     * gcc.target/aarch64/test_frame_4.c: Likewise.
> >     * gcc.target/aarch64/test_frame_6.c: Likewise.
> >     * gcc.target/aarch64/test_frame_7.c: Likewise.
> >     * gcc.target/aarch64/test_frame_8.c: Likewise.
> 
> OK.  I'm afraid this is likely to be an ongoing battle though.

Thanks.

> Maybe we should enforce this at the .exp level instead?
> E.g. we could automatically add -fno-stack-protector to tests that
> aren't being run.
 
I'd say: when a dg-do compile test checks scan-assembler-* and
-fstack-protector* isn't in dg-options, add -fno-stack-protector.

> I suppose it's a question for those who test -fstack-protector
> which is worse: potentially losing some dg-do compile coverage
> of target-specific tests, or having to keep adding explicit
> -fno-stack-protector options.

So far it hasn't been terrible.  We run the testsuite with
-fstack-protector-strong, as well as without it, and it's easy to see
that only the -f-p-s run failed.

Marek

Reply via email to