diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2025-01-31 18:28:23 +0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2025-01-31 19:10:34 +0800 |
commit | 5f34558100e8466aa70373e2f930bf1013192ba8 (patch) | |
tree | eebefacb50e8711d6b188bd60744a97de5c78cfd /gcc | |
parent | 319f1d042179b381becf4bf1d0f6b9dab6e84884 (diff) | |
download | gcc-5f34558100e8466aa70373e2f930bf1013192ba8.zip gcc-5f34558100e8466aa70373e2f930bf1013192ba8.tar.gz gcc-5f34558100e8466aa70373e2f930bf1013192ba8.tar.bz2 |
force-indirect-call-2.c: Allow indirect branch via GOT
r15-1619-g3b9b8d6cfdf593 changed the codegen from
f2:
.cfi_startproc
pushq %rbx
.cfi_def_cfa_offset 16
.cfi_offset 3, -16
movq f1@GOTPCREL(%rip), %rbx
call *%rbx
leaq f3(%rip), %rax
call *%rax
movq %rbx, %rax
popq %rbx
.cfi_def_cfa_offset 8
jmp *%rax
.cfi_endproc
to
f2:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
call *f1@GOTPCREL(%rip)
leaq f3(%rip), %rax
call *%rax
addq $8, %rsp
.cfi_def_cfa_offset 8
jmp *f1@GOTPCREL(%rip)
.cfi_endproc
Since it is OK to indirect call via memory for -mforce-indirect-call,
allow indirect branch via GOT.
PR target/115673
* gcc.target/i386/force-indirect-call-2.c: Allow indirect branch
via GOT.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/force-indirect-call-2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.target/i386/force-indirect-call-2.c b/gcc/testsuite/gcc.target/i386/force-indirect-call-2.c index 2f70236..405c97c8 100644 --- a/gcc/testsuite/gcc.target/i386/force-indirect-call-2.c +++ b/gcc/testsuite/gcc.target/i386/force-indirect-call-2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -mforce-indirect-call -fPIC" } */ /* { dg-require-effective-target fpic } */ -/* { dg-final { scan-assembler-times "(?:call|jmp)\[ \\t\]+\\*%" 3 } } */ +/* { dg-final { scan-assembler-times "(?:call|jmp)\[ \\t\]+\\*" 3 } } */ #include "force-indirect-call-1.c" |