public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/115673] New: [15 regression] gcc.target/i386/force-indirect-call-2.c test failure
@ 2024-06-27  4:48 sjames at gcc dot gnu.org
  2024-06-27  4:50 ` [Bug target/115673] " sjames at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-06-27  4:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115673

            Bug ID: 115673
           Summary: [15 regression]
                    gcc.target/i386/force-indirect-call-2.c test failure
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: testsuite-fail
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: rguenth at gcc dot gnu.org
  Target Milestone: ---

I had these differences when upgrading earlier (with a patched gcc for
PR115661):
```
--- a/x86_64-pc-linux-gnu/15/x86_64-pc-linux-gnu.xfail
+++ b/x86_64-pc-linux-gnu/15/x86_64-pc-linux-gnu.xfail
@@ -438,6 +438,7 @@ FAIL: gcc.dg/nested-vla-1.c (test for excess errors)
 FAIL: gcc.dg/nested-vla-2.c (test for excess errors)
 FAIL: gcc.dg/nested-vla-3.c (test for excess errors)
 FAIL: gcc.dg/packed-vla.c (test for excess errors)
+FAIL: gcc.dg/pr10474.c scan-rtl-dump pro_and_epilogue "Performing
shrink-wrapping"
 FAIL: gcc.dg/pr30473.c (test for excess errors)
 FAIL: gcc.dg/pr34457-1.c (test for excess errors)
 FAIL: gcc.dg/pr38902.c (test for excess errors)
@@ -794,6 +795,7 @@ Running gcc:/gcc/testsuite/gcc.target/i386/i386.exp ...
 FAIL: gcc.target/i386/cet-sjlj-3.c scan-assembler-times call\t_?longjmp 1
 FAIL: gcc.target/i386/cet-sjlj-5.c scan-assembler-times call\t_?longjmp 1
 FAIL: gcc.target/i386/fentryname3.c scan-assembler call\t\\*nop@GOTPCREL
+FAIL: gcc.target/i386/force-indirect-call-2.c scan-assembler-times
(?:call|jmp)[ \\t]+\\*% 3
 FAIL: gcc.target/i386/pr101716.c scan-assembler leal[\\t ][^\\n]*eax
 FAIL: gcc.target/i386/pr101716.c scan-assembler-not movl[\\t ][^\\n]*eax
 FAIL: gcc.target/i386/pr101950-2.c scan-assembler-times \txor[ql]\t 2
@@ -802,6 +804,8 @@ UNRESOLVED: gcc.target/i386/pr113689-1.c compilation failed
to produce executabl
 FAIL: gcc.target/i386/pr85044.c (test for excess errors)
 FAIL: gcc.target/i386/pr86722.c scan-assembler-not orpd
 FAIL: gcc.target/i386/pr86722.c scan-assembler-times
(?n)(?:andnpd|andpd|blendvpd) 1
+FAIL: gcc.target/i386/pr91384.c scan-assembler-not testl
+FAIL: gcc.target/i386/stack-check-17.c scan-assembler-not pop
                === gfortran tests ===
```

Picking on force-indirect-call-2.c:
```
Executing on host: /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 force-indirect-call-2.s    (timeout = 300)
spawn -ignore SIGHUP /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 force-indirect-call-2
gcc.target/i386/force-indirect-call-2.c: (?:call|jmp)[ \\t]+\\*% found 1 times
FAIL: gcc.target/i386/force-indirect-call-2.c scan-assembler-times
(?:call|jmp)[ \\t]+\\*% 3
```

I assume r15-1662-g629257bcb81434?

^ 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 ` 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

end of thread, other threads:[~2024-06-30 16:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [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
2024-06-30  9:53 ` rguenth at gcc dot gnu.org
2024-06-30 16:42 ` ubizjak at gmail dot com

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