public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt
@ 2022-03-12 14:45 rafaelcfsousa at ibm dot com
  2022-03-13  7:36 ` [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux pinskia at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: rafaelcfsousa at ibm dot com @ 2022-03-12 14:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104894
           Summary: [ppc64le] gcc11 ICE with -fno-plt
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rafaelcfsousa at ibm dot com
  Target Milestone: ---

When I use the flag "-fno-plt" together with "-O2 -mcpu=power10" on gcc11, the
compilation fails.

Some important points:
- The ICE shows up only when I use optimization level -O2 or higher
- If I replace "-mcpu=power10" by "-mcpu=power9", the compilation works fine
- The same error does not happen on gcc10

gcc version:
- gcc (GCC) 11.2.1 20220312 [remotes/origin/releases/gcc-11 revision
6f581f90e3:53ab7b79c6:908e612067e42ded881db10d38768f23307bf55e]
- gcc (GCC) 11.2.1 20220211 (Advance-Toolchain 15.0-2) [64575dfb22ae]
- gcc (GCC) 11.2.1 20210728 (Red Hat 11.2.1-1)
- gcc (GCC) 12.0.1 20220312 (experimental) [remotes/origin/HEAD
r12-7622-g828335beb7]
The error shows up on all GCCs above.

the system type: ppc64le (powerpc64le-unknown-linux-gnu)

Configured with: /home/gccbuild/gcc_11_git/gcc/configure
--prefix=/opt/gcc-nightly/11 --with-as=/home/gccbuild/binutils/install/bin/as
--with-ld=/home/gccbuild/binutils/install/bin/ld
--enable-languages=c,c++,fortran,objc,obj-c++ --with-cpu=power10

source file:
issue.c
```
void foo();

void bar() {
   foo();
}
```

the complete command line that triggers the bug:
gcc -O3 -mcpu=power10 -mtune=power10 -fno-plt -c issue.c -o issue.o


the compiler output (error messages, warnings, etc.):
during RTL pass: expand
issue.c: In function ‘bar’:
issue.c:4:4: internal compiler error: in rs6000_sibcall_aix, at
config/rs6000/rs6000.cc:25654
    4 |    foo();
      |    ^~~~~
0x11073563 rs6000_sibcall_aix(rtx_def*, rtx_def*, rtx_def*, rtx_def*)
        /home/gccbuild/gcc_trunk_git/gcc/gcc/config/rs6000/rs6000.cc:25654
0x116acc5f gen_sibcall(rtx_def*, rtx_def*, rtx_def*)
        /home/gccbuild/gcc_trunk_git/gcc/gcc/config/rs6000/rs6000.md:11573
0x1104f17f target_gen_sibcall
        /home/gccbuild/gcc_trunk_git/gcc/gcc/config/rs6000/rs6000.md:13266
0x10486a0f emit_call_1
        /home/gccbuild/gcc_trunk_git/gcc/gcc/calls.cc:469
0x1048f363 expand_call(tree_node*, rtx_def*, int)
        /home/gccbuild/gcc_trunk_git/gcc/gcc/calls.cc:3608
0x106614eb expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /home/gccbuild/gcc_trunk_git/gcc/gcc/expr.cc:11539
0x104b0887 expand_expr
        /home/gccbuild/gcc_trunk_git/gcc/gcc/expr.h:301
0x104b0887 expand_call_stmt
        /home/gccbuild/gcc_trunk_git/gcc/gcc/cfgexpand.cc:2831
0x104b0887 expand_gimple_stmt_1
        /home/gccbuild/gcc_trunk_git/gcc/gcc/cfgexpand.cc:3869
0x104b0887 expand_gimple_stmt
        /home/gccbuild/gcc_trunk_git/gcc/gcc/cfgexpand.cc:4033
0x104b850b expand_gimple_tailcall
        /home/gccbuild/gcc_trunk_git/gcc/gcc/cfgexpand.cc:4079
0x104b850b expand_gimple_basic_block
        /home/gccbuild/gcc_trunk_git/gcc/gcc/cfgexpand.cc:6054
0x104ba5d7 execute
        /home/gccbuild/gcc_trunk_git/gcc/gcc/cfgexpand.cc:6806
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


using --save-temps:
issue.s
```
.file       "issue.c"
.machine    power10
.abiversion 2
.section    ".text"
```

issue.i
```
# 0 "issue.c"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "issue.c"
void foo();

void bar() {
   foo();
}
```

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
@ 2022-03-13  7:36 ` pinskia at gcc dot gnu.org
  2022-03-15  2:28 ` amodra at gmail dot com
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-03-13  7:36 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |powerpc64le-linux-gnu
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=96787
   Target Milestone|---                         |11.3
            Summary|[ppc64le] gcc11 ICE with    |[11/12 Regression] ICE with
                   |-fno-plt                    |-fno-plt -mcpu=power10 on
                   |                            |PowerPC64 LE Linux

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
  2022-03-13  7:36 ` [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux pinskia at gcc dot gnu.org
@ 2022-03-15  2:28 ` amodra at gmail dot com
  2022-03-15  9:02 ` jakub at gcc dot gnu.org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: amodra at gmail dot com @ 2022-03-15  2:28 UTC (permalink / raw)
  To: gcc-bugs

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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amodra at gmail dot com
   Last reconfirmed|                            |2022-03-15
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Alan Modra <amodra at gmail dot com> ---
Regressed with 95f17e26112d8a0 "rs6000: Enable more sibcalls when TOC is not
preserved".  Likely "gcc_assert (INTVAL (cookie) == 0);" in rs6000_sibcall_aix
can just be deleted.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
  2022-03-13  7:36 ` [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux pinskia at gcc dot gnu.org
  2022-03-15  2:28 ` amodra at gmail dot com
@ 2022-03-15  9:02 ` jakub at gcc dot gnu.org
  2022-03-22 21:44 ` bergner at gcc dot gnu.org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-03-15  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I.e. r11-2768-g95f17e26112d8a0700e so that it works as a hyperlink.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
                   ` (2 preceding siblings ...)
  2022-03-15  9:02 ` jakub at gcc dot gnu.org
@ 2022-03-22 21:44 ` bergner at gcc dot gnu.org
  2022-03-23  1:11 ` amodra at gmail dot com
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bergner at gcc dot gnu.org @ 2022-03-22 21:44 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bergner at gcc dot gnu.org,
                   |                            |meissner at gcc dot gnu.org

--- Comment #3 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Alan Modra from comment #1)
> Likely "gcc_assert (INTVAL (cookie) == 0);" in
> rs6000_sibcall_aix can just be deleted.

I think it's still useful to ensure we have a valid sibcall.  The problem is
that with pcrel, we have more opportunities to do a sibcall than we did before,
meaning it doesn't matter if the callee has the same TOC value as us, since we
don't use it.  I think we just need to relax the assert when the caller is
pcrel.  The following fixes the ICE and I'm putting it through a bootstrap &
regtest cycle.

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index a7645820b1e..fc5cfeac4fa 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -25659,7 +25659,7 @@ rs6000_sibcall_aix (rtx value, rtx func_desc, rtx
tlsarg, rtx cookie)
   rtx r12 = NULL_RTX;
   rtx func_addr = func_desc;

-  gcc_assert (INTVAL (cookie) == 0);
+  gcc_assert (rs6000_pcrel_p () || INTVAL (cookie) == 0);

   if (global_tlsarg)
     tlsarg = global_tlsarg;

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
                   ` (3 preceding siblings ...)
  2022-03-22 21:44 ` bergner at gcc dot gnu.org
@ 2022-03-23  1:11 ` amodra at gmail dot com
  2022-03-23 12:54 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: amodra at gmail dot com @ 2022-03-23  1:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Alan Modra <amodra at gmail dot com> ---
Do check that the result is not a direct call.  I think I was wrong to say the
assert could be removed (or modified as you have done).

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
                   ` (4 preceding siblings ...)
  2022-03-23  1:11 ` amodra at gmail dot com
@ 2022-03-23 12:54 ` rguenth at gcc dot gnu.org
  2022-03-24 21:33 ` bergner at gcc dot gnu.org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-03-23 12:54 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
                   ` (5 preceding siblings ...)
  2022-03-23 12:54 ` rguenth at gcc dot gnu.org
@ 2022-03-24 21:33 ` bergner at gcc dot gnu.org
  2022-03-24 23:55 ` amodra at gmail dot com
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bergner at gcc dot gnu.org @ 2022-03-24 21:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Alan Modra from comment #4)
> Do check that the result is not a direct call.  I think I was wrong to say
> the assert could be removed (or modified as you have done).

I'm assuming you mean check that we DO have a direct call.

When we talked offline, you said you were worried about what happens when we
use -mlongcall with this test csae.  When I use that option, we never end up
calling rs6000_sibcall_aix(), so that option basically disables sibling calls
altogether.  I believe if we call rs6000_sibcall_aix(), we know we have a
direct call that is also a valid sibling call and the assert is just confirming
that.

Before pcrel, valid sibling calls required the caller and callee to have the
same TOC value (which is what that assert was verifying) because the TOC
restore is done in the caller and not the callee and if we do a sibling call,
we'll skip the TOC restore in the caller, which only works if the callee has
the same TOC value.

Now with pcrel, the caller doesn't use r2 as a TOC pointer at all and doesn't
expect or need it to be restored.  Additionally, callers to a pcrel function
don't expect r2 to be preserved either.  This allows pcrel callers to sibling
call callees we couldn't before, so I think we do just want to relax the assert
to verify we have the same TOC value only when the caller is not pcrel.

Given we only call rs6000_sibcall_aix() with direct calls that are valid for
sibling calls, do you agree my patch above is ok or do you see some other issue
I'm not thinking of?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
                   ` (6 preceding siblings ...)
  2022-03-24 21:33 ` bergner at gcc dot gnu.org
@ 2022-03-24 23:55 ` amodra at gmail dot com
  2022-03-25  0:02 ` amodra at gmail dot com
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: amodra at gmail dot com @ 2022-03-24 23:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Alan Modra <amodra at gmail dot com> ---
I'm sorry, I forgot exactly what was happening when I talked about this on the
call.  What I should have said is that -mlongcall code is correct but is
missing a sibcall optimisation.  -fno-plt code (after removing the assert or
using your patch) is incorrect.  A direct call is wrong, because it may require
a plt call stub.  gcc ought to be producing an inline plt call.  Change the
testcase to

void foo();

void bar() {
   foo();
   foo();
}

to see what I mean.  The asm output is

        mflr 0
        std 0,16(1)
        stdu 1,-96(1)
        .cfi_def_cfa_offset 96
        .cfi_offset 65, 16
        pld 12,0(0),1
        .reloc .-8,R_PPC64_PLT_PCREL34_NOTOC,foo
        mtctr 12
        .reloc .-4,R_PPC64_PLTSEQ,foo
        .reloc .,R_PPC64_PLTCALL_NOTOC,foo
        bctrl
        addi 1,1,96
        .cfi_def_cfa_offset 0
        ld 0,16(1)
        mtlr 0
        .cfi_restore 65
        b foo@notoc

That "b foo@notoc" ought to be
        pld 12,0(0),1
        .reloc .-8,R_PPC64_PLT_PCREL34_NOTOC,foo
        mtctr 12
        .reloc .-4,R_PPC64_PLTSEQ,foo
        .reloc .,R_PPC64_PLTCALL_NOTOC,foo
        bctr

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
                   ` (7 preceding siblings ...)
  2022-03-24 23:55 ` amodra at gmail dot com
@ 2022-03-25  0:02 ` amodra at gmail dot com
  2022-04-04 22:13 ` bergner at gcc dot gnu.org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: amodra at gmail dot com @ 2022-03-25  0:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Alan Modra <amodra at gmail dot com> ---
So, similar code to what we have in rs6000_call_aix to handle
  if ((INTVAL (cookie) & CALL_LONG) != 0
      && GET_CODE (func_desc) == SYMBOL_REF)
should be added to rs6000_sibcall_aix, I think.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
                   ` (8 preceding siblings ...)
  2022-03-25  0:02 ` amodra at gmail dot com
@ 2022-04-04 22:13 ` bergner at gcc dot gnu.org
  2022-04-05 22:07 ` bergner at gcc dot gnu.org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bergner at gcc dot gnu.org @ 2022-04-04 22:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Peter Bergner <bergner at gcc dot gnu.org> ---
Sorry for the delay, but getting back to this now...

(In reply to Alan Modra from comment #6)
> What I should have said is that -mlongcall code is correct but is
> missing a sibcall optimisation.  -fno-plt code (after removing the assert or
> using your patch) is incorrect.  A direct call is wrong, because it may
> require a plt call stub.  gcc ought to be producing an inline plt call. 

First off, is it just me, or does the -fno-plt option seem to slow down
basically all function calls since it forces us to emit a call that uses an
inline plt?  Even for functions that don't need it. 


> Change the testcase to
> 
> void foo();
> 
> void bar() {
>    foo();
>    foo();
> }
> 
> to see what I mean.  The asm output is
[snip]
> That "b foo@notoc" ought to be
>         pld 12,0(0),1
>         .reloc .-8,R_PPC64_PLT_PCREL34_NOTOC,foo
>         mtctr 12
>         .reloc .-4,R_PPC64_PLTSEQ,foo
>         .reloc .,R_PPC64_PLTCALL_NOTOC,foo
>         bctr

Thanks for the education!  The change below gives us that code sequence:

bar:
.LFB0:
        .cfi_startproc
        .localentry     bar,1
        mflr 0
        std 0,16(1)
        stdu 1,-96(1)
        .cfi_def_cfa_offset 96
        .cfi_offset 65, 16
        pld 12,0(0),1
        .reloc .-8,R_PPC64_PLT_PCREL34_NOTOC,foo
        mtctr 12
        .reloc .-4,R_PPC64_PLTSEQ,foo
        .reloc .,R_PPC64_PLTCALL_NOTOC,foo
        bctrl
        pld 12,0(0),1
        .reloc .-8,R_PPC64_PLT_PCREL34_NOTOC,foo
        addi 1,1,96
        .cfi_def_cfa_offset 0
        mtctr 12
        ld 0,16(1)
        mtlr 0
        .cfi_restore 65
        bctr

How does this look now?  I'll go ahead and regtest this.


diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index cb18db06a2d..e045657a2b0 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -25659,11 +25659,21 @@ rs6000_sibcall_aix (rtx value, rtx func_desc, rtx
tlsarg, rtx cookie)
   rtx r12 = NULL_RTX;
   rtx func_addr = func_desc;

-  gcc_assert (INTVAL (cookie) == 0);
-
   if (global_tlsarg)
     tlsarg = global_tlsarg;

+  /* Handle longcall attributes.  */
+  if ((INTVAL (cookie) & CALL_LONG) != 0
+      && GET_CODE (func_desc) == SYMBOL_REF)
+    {
+      /* Only PCREL can do a sibling call to a longcall function,
+        because we don't need to restore the TOC register.  */
+      gcc_assert (rs6000_pcrel_p ());
+      func_desc = rs6000_longcall_ref (func_desc, tlsarg);
+    }
+  else
+    gcc_assert (INTVAL (cookie) == 0);
+
   /* For ELFv2, r12 and CTR need to hold the function address
      for an indirect call.  */
   if (GET_CODE (func_desc) != SYMBOL_REF && DEFAULT_ABI == ABI_ELFv2)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
                   ` (9 preceding siblings ...)
  2022-04-04 22:13 ` bergner at gcc dot gnu.org
@ 2022-04-05 22:07 ` bergner at gcc dot gnu.org
  2022-04-11 22:02 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: bergner at gcc dot gnu.org @ 2022-04-05 22:07 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |bergner at gcc dot gnu.org
             Status|NEW                         |ASSIGNED
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2022-April/5
                   |                            |92808.html

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
                   ` (10 preceding siblings ...)
  2022-04-05 22:07 ` bergner at gcc dot gnu.org
@ 2022-04-11 22:02 ` cvs-commit at gcc dot gnu.org
  2022-04-12 20:24 ` cvs-commit at gcc dot gnu.org
  2022-04-12 20:32 ` bergner at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-11 22:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Peter Bergner <bergner@gcc.gnu.org>:

https://gcc.gnu.org/g:d74c4c6a1b4956b5cd9b2a770bb7261836fa1289

commit r12-8095-gd74c4c6a1b4956b5cd9b2a770bb7261836fa1289
Author: Peter Bergner <bergner@linux.ibm.com>
Date:   Mon Apr 11 17:00:44 2022 -0500

    rs6000: Handle pcrel sibcalls to longcall functions [PR104894]

    Before PCREL in POWER10, we were not allowed to perform sibcalls to
longcall
    functions since callee's return would skip the TOC restore in the caller.
    However, with PCREL we can now safely perform a sibling call to longcall
    functions.  The problem with the current code is that pcrel sibcall
    branches to a PLT stub label even though -fno-plt was used.  The solution
    here is to check for a pcrel longcall and emit an inline plt stub in
    that case.

    2022-04-11  Peter Bergner  <bergner@linux.ibm.com>

    gcc/
            PR target/104894
            * config/rs6000/rs6000.cc (rs6000_sibcall_aix): Handle pcrel
sibcalls
            to longcall functions.

    gcc/testsuite/
            PR target/104894
            * gcc.target/powerpc/pr104894.c: New test.
            * gcc.target/powerpc/pr104894-2.c: New test.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
                   ` (11 preceding siblings ...)
  2022-04-11 22:02 ` cvs-commit at gcc dot gnu.org
@ 2022-04-12 20:24 ` cvs-commit at gcc dot gnu.org
  2022-04-12 20:32 ` bergner at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-12 20:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Peter Bergner
<bergner@gcc.gnu.org>:

https://gcc.gnu.org/g:5ede37c0f274f0de19afd662588891e32b60f705

commit r11-9836-g5ede37c0f274f0de19afd662588891e32b60f705
Author: Peter Bergner <bergner@linux.ibm.com>
Date:   Tue Apr 12 14:08:53 2022 -0500

    rs6000: Handle pcrel sibcalls to longcall functions [PR104894]

    Before PCREL in POWER10, we were not allowed to perform sibcalls to
longcall
    functions since callee's return would skip the TOC restore in the caller.
    However, with PCREL we can now safely perform a sibling call to longcall
    functions.  The problem with the current code is that pcrel sibcall
    branches to a PLT stub label even though -fno-plt was used.  The solution
    here is to check for a pcrel longcall and emit an inline plt stub in
    that case.

    2022-04-11  Peter Bergner  <bergner@linux.ibm.com>

    gcc/
            PR target/104894
            * config/rs6000/rs6000.c (rs6000_sibcall_aix): Handle pcrel
sibcalls
            to longcall functions.

    gcc/testsuite/
            PR target/104894
            * gcc.target/powerpc/pr104894.c: New test.
            * gcc.target/powerpc/pr104894-2.c: New test.

    (cherry picked from commit d74c4c6a1b4956b5cd9b2a770bb7261836fa1289)

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux
  2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
                   ` (12 preceding siblings ...)
  2022-04-12 20:24 ` cvs-commit at gcc dot gnu.org
@ 2022-04-12 20:32 ` bergner at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: bergner at gcc dot gnu.org @ 2022-04-12 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #11 from Peter Bergner <bergner at gcc dot gnu.org> ---
Fixed everywhere.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-04-12 20:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-12 14:45 [Bug c/104894] New: [ppc64le] gcc11 ICE with -fno-plt rafaelcfsousa at ibm dot com
2022-03-13  7:36 ` [Bug target/104894] [11/12 Regression] ICE with -fno-plt -mcpu=power10 on PowerPC64 LE Linux pinskia at gcc dot gnu.org
2022-03-15  2:28 ` amodra at gmail dot com
2022-03-15  9:02 ` jakub at gcc dot gnu.org
2022-03-22 21:44 ` bergner at gcc dot gnu.org
2022-03-23  1:11 ` amodra at gmail dot com
2022-03-23 12:54 ` rguenth at gcc dot gnu.org
2022-03-24 21:33 ` bergner at gcc dot gnu.org
2022-03-24 23:55 ` amodra at gmail dot com
2022-03-25  0:02 ` amodra at gmail dot com
2022-04-04 22:13 ` bergner at gcc dot gnu.org
2022-04-05 22:07 ` bergner at gcc dot gnu.org
2022-04-11 22:02 ` cvs-commit at gcc dot gnu.org
2022-04-12 20:24 ` cvs-commit at gcc dot gnu.org
2022-04-12 20:32 ` bergner at gcc dot gnu.org

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