* [Bug target/115673] [15 regression] gcc.target/i386/force-indirect-call-2.c test failure
2024-06-27 4:48 [Bug target/115673] New: [15 regression] gcc.target/i386/force-indirect-call-2.c test failure sjames at gcc dot gnu.org
@ 2024-06-27 4:50 ` sjames at gcc dot gnu.org
2024-06-27 4:50 ` [Bug rtl-optimization/115673] " pinskia at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-06-27 4:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115673
--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
$ diff -u <(gcc-14
/home/sam/git/gcc/gcc/testsuite/gcc.target/i386/force-indirect-call-2.c
-fdiagnostics-plain-output -O2 -mforce-indirect-call -fPIC -ffat-lto-objects
-fno-ident -S -o -) <(/tmp/build/gcc/xgcc -B/tmp/build/gcc/
/home/sam/git/gcc/gcc/testsuite/gcc.target/i386/force-indirect-call-2.c
-fdiagnostics-plain-output -O2 -mforce-indirect-call -fPIC -ffat-lto-objects
-fno-ident -S -o -)
--- /dev/fd/63 2024-06-27 05:49:53.355792646 +0100
+++ /dev/fd/62 2024-06-27 05:49:53.357792668 +0100
@@ -29,17 +29,14 @@
f2:
.LFB2:
.cfi_startproc
- pushq %rbx
+ subq $8, %rsp
.cfi_def_cfa_offset 16
- .cfi_offset 3, -16
- movq f1@GOTPCREL(%rip), %rbx
- call *%rbx
+ call *f1@GOTPCREL(%rip)
leaq f3(%rip), %rax
call *%rax
- movq %rbx, %rax
- popq %rbx
+ addq $8, %rsp
.cfi_def_cfa_offset 8
- jmp *%rax
+ jmp *f1@GOTPCREL(%rip)
.cfi_endproc
.LFE2:
.size f2, .-f2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug rtl-optimization/115673] [15 regression] gcc.target/i386/force-indirect-call-2.c test failure
2024-06-27 4:48 [Bug target/115673] New: [15 regression] gcc.target/i386/force-indirect-call-2.c test failure sjames at gcc dot gnu.org
2024-06-27 4:50 ` [Bug target/115673] " sjames at gcc dot gnu.org
@ 2024-06-27 4:50 ` pinskia at gcc dot gnu.org
2024-06-27 5:59 ` [Bug target/115673] " rguenth at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-27 4:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115673
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|target |rtl-optimization
Last reconfirmed| |2024-06-27
CC| |pinskia at gcc dot gnu.org
Status|UNCONFIRMED |NEW
Target Milestone|--- |15.0
Ever confirmed|0 |1
Keywords| |missed-optimization, ra
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://gcc.gnu.org/pipermail/gcc-patches/2024-June/655721.html
r15-1619-g3b9b8d6cfdf593
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/115673] [15 regression] gcc.target/i386/force-indirect-call-2.c test failure
2024-06-27 4:48 [Bug target/115673] New: [15 regression] gcc.target/i386/force-indirect-call-2.c test failure sjames at gcc dot gnu.org
2024-06-27 4:50 ` [Bug target/115673] " sjames at gcc dot gnu.org
2024-06-27 4:50 ` [Bug rtl-optimization/115673] " pinskia at gcc dot gnu.org
@ 2024-06-27 5:59 ` rguenth at gcc dot gnu.org
2024-06-27 6:02 ` sjames at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-06-27 5:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115673
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|unknown |15.0
Target| |x86_64-*-*
CC| |uros at gcc dot gnu.org
Component|rtl-optimization |target
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
That's the bogus got alias set change.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/115673] [15 regression] gcc.target/i386/force-indirect-call-2.c test failure
2024-06-27 4:48 [Bug target/115673] New: [15 regression] gcc.target/i386/force-indirect-call-2.c test failure sjames at gcc dot gnu.org
` (2 preceding siblings ...)
2024-06-27 5:59 ` [Bug target/115673] " rguenth at gcc dot gnu.org
@ 2024-06-27 6:02 ` sjames at gcc dot gnu.org
2024-06-28 15:23 ` sjames at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-06-27 6:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115673
Sam James <sjames at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=115661
--- Comment #4 from Sam James <sjames at gcc dot gnu.org> ---
FWIW, I hit it with a revert applied (not just the expand_move fix) to fix it,
but I didn't test it very thoroughly. The CI report would've been without any
revert.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/115673] [15 regression] gcc.target/i386/force-indirect-call-2.c test failure
2024-06-27 4:48 [Bug target/115673] New: [15 regression] gcc.target/i386/force-indirect-call-2.c test failure sjames at gcc dot gnu.org
` (3 preceding siblings ...)
2024-06-27 6:02 ` sjames at gcc dot gnu.org
@ 2024-06-28 15:23 ` sjames at gcc dot gnu.org
2024-06-30 9:53 ` rguenth at gcc dot gnu.org
2024-06-30 16:42 ` ubizjak at gmail dot com
6 siblings, 0 replies; 8+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-06-28 15:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115673
--- Comment #5 from Sam James <sjames at gcc dot gnu.org> ---
Still fails with the GOT alias set fix on trunk.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/115673] [15 regression] gcc.target/i386/force-indirect-call-2.c test failure
2024-06-27 4:48 [Bug target/115673] New: [15 regression] gcc.target/i386/force-indirect-call-2.c test failure sjames at gcc dot gnu.org
` (4 preceding siblings ...)
2024-06-28 15:23 ` sjames at gcc dot gnu.org
@ 2024-06-30 9:53 ` rguenth at gcc dot gnu.org
2024-06-30 16:42 ` ubizjak at gmail dot com
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-06-30 9:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115673
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|rguenth at gcc dot gnu.org |
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
So it likely expects f1@GOTPCREL(%rip) to be CSEd?
f2:
.LFB2:
.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)
indeed with GCC 14 we get
f2:
.LFB2:
.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
I think both are perfectly OK for what the testcase should expect, so it's
a testism. But I think it's also a missed optimization now.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug target/115673] [15 regression] gcc.target/i386/force-indirect-call-2.c test failure
2024-06-27 4:48 [Bug target/115673] New: [15 regression] gcc.target/i386/force-indirect-call-2.c test failure sjames at gcc dot gnu.org
` (5 preceding siblings ...)
2024-06-30 9:53 ` rguenth at gcc dot gnu.org
@ 2024-06-30 16:42 ` ubizjak at gmail dot com
6 siblings, 0 replies; 8+ messages in thread
From: ubizjak at gmail dot com @ 2024-06-30 16:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115673
--- Comment #7 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #6)
> So it likely expects f1@GOTPCREL(%rip) to be CSEd?
>
> f2:
> .LFB2:
> .cfi_startproc
> subq $8, %rsp
> .cfi_def_cfa_offset 16
> call *f1@GOTPCREL(%rip)
This call is not indirect (through the register).
> leaq f3(%rip), %rax
> call *%rax
> addq $8, %rsp
> .cfi_def_cfa_offset 8
> jmp *f1@GOTPCREL(%rip)
Neither is this sibcall indirect.
'-mforce-indirect-call'
Force all calls to functions to be indirect. This is useful when
using Intel Processor Trace where it generates more precise timing
information for function calls.
^ permalink raw reply [flat|nested] 8+ messages in thread