public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors
@ 2020-12-03 16:31 seurer at gcc dot gnu.org
  2020-12-03 16:36 ` [Bug testsuite/98125] " hjl.tools at gmail dot com
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: seurer at gcc dot gnu.org @ 2020-12-03 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98125
           Summary: New test case g++.dg/pr93195a.C in r11-5656 has excess
                    errors
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:694d4a6d0c466d0fbc97920a9c6641a7b349ca35, r11-5656

make  -k check-gcc RUNTESTFLAGS="dg.exp=g++.dg/pr93195a.C"
FAIL: g++.dg/pr93195a.C  -std=gnu++98 (test for excess errors)
FAIL: g++.dg/pr93195a.C  -std=gnu++14 (test for excess errors)
FAIL: g++.dg/pr93195a.C  -std=gnu++17 (test for excess errors)
FAIL: g++.dg/pr93195a.C  -std=gnu++2a (test for excess errors)
# of unexpected failures        4

The errors are all this:

collect2: error: ld returned 1 exit status
compiler exited with status 1
FAIL: g++.dg/pr93195a.C  -std=gnu++14 (test for excess errors)
Excess errors:
`.text._Z3foov' referenced in section `__patchable_function_entries' of
/tmp/ccwJ1d6k.o: defined in discarded section `.text._Z3foov[_Z3foov]' of
/tmp/ccwJ1d6k.o

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

* [Bug testsuite/98125] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
@ 2020-12-03 16:36 ` hjl.tools at gmail dot com
  2020-12-03 16:56 ` seurer at gcc dot gnu.org
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl.tools at gmail dot com @ 2020-12-03 16:36 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-12-03

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Please show

$ grep HAVE_GAS_SECTION_LINK_ORDER auto-host.h

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

* [Bug testsuite/98125] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
  2020-12-03 16:36 ` [Bug testsuite/98125] " hjl.tools at gmail dot com
@ 2020-12-03 16:56 ` seurer at gcc dot gnu.org
  2020-12-03 18:20 ` hjl.tools at gmail dot com
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: seurer at gcc dot gnu.org @ 2020-12-03 16:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from seurer at gcc dot gnu.org ---
#define HAVE_GAS_SECTION_LINK_ORDER 1

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

* [Bug testsuite/98125] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
  2020-12-03 16:36 ` [Bug testsuite/98125] " hjl.tools at gmail dot com
  2020-12-03 16:56 ` seurer at gcc dot gnu.org
@ 2020-12-03 18:20 ` hjl.tools at gmail dot com
  2020-12-03 20:18 ` hjl.tools at gmail dot com
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl.tools at gmail dot com @ 2020-12-03 18:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to seurer from comment #2)
> #define HAVE_GAS_SECTION_LINK_ORDER 1

Please show the command line options passed to ld, pass --dependency-file=FILE
to ld to list all linker input files and upload all linker input files so that
I can investigate with a cross linker.

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

* [Bug testsuite/98125] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-12-03 18:20 ` hjl.tools at gmail dot com
@ 2020-12-03 20:18 ` hjl.tools at gmail dot com
  2020-12-04  6:09 ` amodra at gmail dot com
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: hjl.tools at gmail dot com @ 2020-12-03 20:18 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amodra at gmail dot com

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to seurer from comment #0)
> g:694d4a6d0c466d0fbc97920a9c6641a7b349ca35, r11-5656
> 
> make  -k check-gcc RUNTESTFLAGS="dg.exp=g++.dg/pr93195a.C"
> FAIL: g++.dg/pr93195a.C  -std=gnu++98 (test for excess errors)
> FAIL: g++.dg/pr93195a.C  -std=gnu++14 (test for excess errors)
> FAIL: g++.dg/pr93195a.C  -std=gnu++17 (test for excess errors)
> FAIL: g++.dg/pr93195a.C  -std=gnu++2a (test for excess errors)
> # of unexpected failures	4
> 
> The errors are all this:
> 
> collect2: error: ld returned 1 exit status
> compiler exited with status 1
> FAIL: g++.dg/pr93195a.C  -std=gnu++14 (test for excess errors)
> Excess errors:
> `.text._Z3foov' referenced in section `__patchable_function_entries' of
> /tmp/ccwJ1d6k.o: defined in discarded section `.text._Z3foov[_Z3foov]' of
> /tmp/ccwJ1d6k.o

This is a PowerPC specific issue.  I don't know how
__patchable_function_entries
works on PowerPC.

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

* [Bug testsuite/98125] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-12-03 20:18 ` hjl.tools at gmail dot com
@ 2020-12-04  6:09 ` amodra at gmail dot com
  2020-12-04  7:11 ` [Bug testsuite/98125] [11 Regression] " rguenth at gcc dot gnu.org
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: amodra at gmail dot com @ 2020-12-04  6:09 UTC (permalink / raw)
  To: gcc-bugs

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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #5 from Alan Modra <amodra at gmail dot com> ---
The default implementation of -fpatchable-function-entry is broken and useless
on powerpc64 ELFv1 and ELFv2.  For ELFv1 we get

        .section        ".opd","aw"
        .align 3
_Z3foov:
        .quad   .L._Z3foov,.TOC.@tocbase,0
        .previous
        .type   _Z3foov, @function
.L._Z3foov:
        .section        __patchable_function_entries,"awo",@progbits,_Z3foov
        .align 3
        .8byte  .LPFE1
        .section        .text._Z3foov,"axG",@progbits,_Z3foov,comdat
.LPFE1:
        nop

So the "o" flag symbol is one in the .opd section, rather than what would be
correct here, .L._Z3foov.

The implementation is even more useless for ELFv2, with the nop appearing in
the global entry code (so providing patch space for only some calls of the
function),
which results in assembler complaints about ".localentry expression is not a
power of 2".

I don't think there is anything wrong with the new testcase, just a lack of
xfail powerpc64*-*-*.

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-12-04  6:09 ` amodra at gmail dot com
@ 2020-12-04  7:11 ` rguenth at gcc dot gnu.org
  2020-12-04 12:00 ` amodra at gmail dot com
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-12-04  7:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|New test case               |[11 Regression] New test
                   |g++.dg/pr93195a.C in        |case g++.dg/pr93195a.C in
                   |r11-5656 has excess errors  |r11-5656 has excess errors
   Target Milestone|---                         |11.0

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
dg-skip-if I suppose

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-12-04  7:11 ` [Bug testsuite/98125] [11 Regression] " rguenth at gcc dot gnu.org
@ 2020-12-04 12:00 ` amodra at gmail dot com
  2020-12-07 21:45 ` amodra at gmail dot com
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: amodra at gmail dot com @ 2020-12-04 12:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Alan Modra <amodra at gmail dot com> ---
(In reply to Alan Modra from comment #5)
> So the "o" flag symbol is one in the .opd section, rather than what would be
> correct here, .L._Z3foov.

Actually, that breakage happened recently with commit 694d4a6d0c4.  ie. it
looks like powerpc64 ELFv1 was broken by HJ's patch.  I tend to care more about
powerpc64 ELFv2, ie powerpc64le, which was broken prior to that patch.

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2020-12-04 12:00 ` amodra at gmail dot com
@ 2020-12-07 21:45 ` amodra at gmail dot com
  2021-01-14 11:01 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: amodra at gmail dot com @ 2020-12-07 21:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Alan Modra <amodra at gmail dot com> ---
Created attachment 49701
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49701&action=edit
fix powerpc64 -fpatchable-function-entry

This makes -fpatchable-function-entry do something sensible on powerpc64 ELFv1
and ELFv2.  The ELFv2 fix is all rs6000 backend trickery, ELFv1 needs a change
to generic code to use the function code section symbol rather than the
function symbol as the "o" argument for the __patchable_function_entries
.section directive.  Regression testing only done powerpc64le-linux so far.

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2020-12-07 21:45 ` amodra at gmail dot com
@ 2021-01-14 11:01 ` rguenth at gcc dot gnu.org
  2021-01-22 15:16 ` jakub at gcc dot gnu.org
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-14 11:01 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2021-01-14 11:01 ` rguenth at gcc dot gnu.org
@ 2021-01-22 15:16 ` jakub at gcc dot gnu.org
  2021-01-22 21:05 ` seurer at gcc dot gnu.org
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-22 15:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
What is the current status of this PR?

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2021-01-22 15:16 ` jakub at gcc dot gnu.org
@ 2021-01-22 21:05 ` seurer at gcc dot gnu.org
  2021-01-22 22:13 ` amodra at gmail dot com
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: seurer at gcc dot gnu.org @ 2021-01-22 21:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from seurer at gcc dot gnu.org ---
It is still failing for me so I'd guess that Alan's patch is not submitted yet.

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2021-01-22 21:05 ` seurer at gcc dot gnu.org
@ 2021-01-22 22:13 ` amodra at gmail dot com
  2021-01-22 22:18 ` amodra at gmail dot com
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: amodra at gmail dot com @ 2021-01-22 22:13 UTC (permalink / raw)
  To: gcc-bugs

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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #49701|0                           |1
        is obsolete|                            |

--- Comment #11 from Alan Modra <amodra at gmail dot com> ---
Created attachment 50038
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50038&action=edit
ELFv2 support

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2021-01-22 22:13 ` amodra at gmail dot com
@ 2021-01-22 22:18 ` amodra at gmail dot com
  2021-02-12 15:13 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: amodra at gmail dot com @ 2021-01-22 22:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Alan Modra <amodra at gmail dot com> ---
Created attachment 50039
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50039&action=edit
ELFv1 support

Revised patches.  I wasn't happy with the use of a ".text" symbol in the
previous patch since some targets don't call their text section ".text".  These
are really stage1 material.  Usable -fpatchable-funtion-entry on powerpc64 is a
new feature.

I'm inclined to think the new test should just be skipped on powerpc64*-*. 
Bill, could you handle the testsuite fixes please?

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2021-01-22 22:18 ` amodra at gmail dot com
@ 2021-02-12 15:13 ` jakub at gcc dot gnu.org
  2021-02-16  1:07 ` amodra at gmail dot com
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-12 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think -fpatchable-function-entry support is more than 3 years old now, so I
think we can't treat it like a new feature and so I don't understand defering
fixing it for stage1.  Doesn't the kernel use that option too for quite some
time?

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2021-02-12 15:13 ` jakub at gcc dot gnu.org
@ 2021-02-16  1:07 ` amodra at gmail dot com
  2021-02-23 15:29 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: amodra at gmail dot com @ 2021-02-16  1:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Alan Modra <amodra at gmail dot com> ---
-fpatchable-function-entry isn't used by the powerpc linux kernel.

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2021-02-16  1:07 ` amodra at gmail dot com
@ 2021-02-23 15:29 ` jakub at gcc dot gnu.org
  2021-02-23 15:32 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-23 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
In any case, if the option is totally broken, we should either fix it for GCC
11 or emit sorry message to make it clear to users the option is not supported.

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2021-02-23 15:29 ` jakub at gcc dot gnu.org
@ 2021-02-23 15:32 ` jakub at gcc dot gnu.org
  2021-03-30 13:02 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-23 15:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
But the latter (i.e. sorry) only if it always has been broken for that target.
#c7 seems to suggest it worked in ELFv1 (does it work on powerpc -m32?) and got
broken by H.J's change, then we should fix it rather than stop supporting it.
And if it has always been broken on powerpc64le, then sorry might be one of the
options.

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2021-02-23 15:32 ` jakub at gcc dot gnu.org
@ 2021-03-30 13:02 ` jakub at gcc dot gnu.org
  2021-03-30 14:10 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-30 13:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As a quick hack, we could do e.g.
--- gcc/configure.ac    2021-03-23 19:42:05.417907561 +0100
+++ gcc/configure.ac    2021-03-30 14:54:31.655766205 +0200
@@ -3404,12 +3404,15 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_GNU_RETA
 # Test if the assembler supports the section flag 'o' for specifying
 # section with link-order.
 case "${target}" in
-  # Solaris may use GNU assembler with Solairs ld.  Even if GNU
+  # Solaris may use GNU assembler with Solaris ld.  Even if GNU
   # assembler supports the section flag 'o', it doesn't mean that
   # Solairs ld supports it.
   *-*-solaris2*)
     gcc_cv_as_section_link_order=no
     ;;
+  powerpc*-*-*)
+    gcc_cv_as_section_link_order=no
+    ;;
   *)
     gcc_GAS_CHECK_FEATURE([section 'o' flag], gcc_cv_as_section_link_order,
       [2,35,0], [--fatal-warnings],
i.e. effectively revert H.J's patch for powerpc* targets.
That is a hack rather than proper solution.
For GCC11 we need some solution at least for the P1 regression, i.e. the
ELFv1 support that worked in the past and was broken by
r11-5656-g694d4a6d0c466d0fbc97920a9c6641a7b349ca35

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2021-03-30 13:02 ` jakub at gcc dot gnu.org
@ 2021-03-30 14:10 ` jakub at gcc dot gnu.org
  2021-04-03  8:04 ` cvs-commit at gcc dot gnu.org
  2021-04-03  8:16 ` jakub at gcc dot gnu.org
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-03-30 14:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Another more targeted partial reversion:
2021-03-30  Jakub Jelinek  <jakub@redhat.com>

        * targhooks.h (default_print_patchable_function_entry_1): Declare.
        * targhooks.c (default_print_patchable_function_entry_1): New function,
        copied from default_print_patchable_function_entry with an added flags
        argument.
        (default_print_patchable_function_entry): Rewritten into a small
        wrapper around default_print_patchable_function_entry_1.
        * config/rs6000/rs6000.c (TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY):
        Redefine.
        (rs6000_print_patchable_function_entry): New function.

--- gcc/targhooks.h.jj  2021-01-04 10:25:39.665224403 +0100
+++ gcc/targhooks.h     2021-03-30 15:48:42.826706369 +0200
@@ -230,6 +230,9 @@ extern bool default_use_by_pieces_infras
                                                    bool);
 extern int default_compare_by_pieces_branch_ratio (machine_mode);

+extern void default_print_patchable_function_entry_1 (FILE *,
+                                                     unsigned HOST_WIDE_INT,
+                                                     bool, unsigned int);
 extern void default_print_patchable_function_entry (FILE *,
                                                    unsigned HOST_WIDE_INT,
                                                    bool);
--- gcc/targhooks.c.jj  2021-01-04 10:25:38.974232228 +0100
+++ gcc/targhooks.c     2021-03-30 15:51:22.924932795 +0200
@@ -1832,17 +1832,15 @@ default_compare_by_pieces_branch_ratio (
   return 1;
 }

-/* Write PATCH_AREA_SIZE NOPs into the asm outfile FILE around a function
-   entry.  If RECORD_P is true and the target supports named sections,
-   the location of the NOPs will be recorded in a special object section
-   called "__patchable_function_entries".  This routine may be called
-   twice per function to put NOPs before and after the function
-   entry.  */
+/* Helper for default_print_patchable_function_entry and other
+   print_patchable_function_entry hook implementations.  */

 void
-default_print_patchable_function_entry (FILE *file,
-                                       unsigned HOST_WIDE_INT patch_area_size,
-                                       bool record_p)
+default_print_patchable_function_entry_1 (FILE *file,
+                                         unsigned HOST_WIDE_INT
+                                         patch_area_size,
+                                         bool record_p,
+                                         unsigned int flags)
 {
   const char *nop_templ = 0;
   int code_num;
@@ -1864,9 +1862,6 @@ default_print_patchable_function_entry (
       patch_area_number++;
       ASM_GENERATE_INTERNAL_LABEL (buf, "LPFE", patch_area_number);

-      unsigned int flags = SECTION_WRITE | SECTION_RELRO;
-      if (HAVE_GAS_SECTION_LINK_ORDER)
-       flags |= SECTION_LINK_ORDER;
       switch_to_section (get_section ("__patchable_function_entries",
                                      flags, current_function_decl));
       assemble_align (POINTER_SIZE);
@@ -1883,6 +1878,25 @@ default_print_patchable_function_entry (
     output_asm_insn (nop_templ, NULL);
 }

+/* Write PATCH_AREA_SIZE NOPs into the asm outfile FILE around a function
+   entry.  If RECORD_P is true and the target supports named sections,
+   the location of the NOPs will be recorded in a special object section
+   called "__patchable_function_entries".  This routine may be called
+   twice per function to put NOPs before and after the function
+   entry.  */
+
+void
+default_print_patchable_function_entry (FILE *file,
+                                       unsigned HOST_WIDE_INT patch_area_size,
+                                       bool record_p)
+{
+  unsigned int flags = SECTION_WRITE | SECTION_RELRO;
+  if (HAVE_GAS_SECTION_LINK_ORDER)
+    flags |= SECTION_LINK_ORDER;
+  default_print_patchable_function_entry_1 (file, patch_area_size, record_p,
+                                           flags);
+}
+
 bool
 default_profile_before_prologue (void)
 {
--- gcc/config/rs6000/rs6000.c.jj       2021-03-29 11:15:49.942202792 +0200
+++ gcc/config/rs6000/rs6000.c  2021-03-30 15:59:10.299755166 +0200
@@ -1341,6 +1341,9 @@ static const struct attribute_spec rs600
 #define TARGET_ASM_ASSEMBLE_VISIBILITY rs6000_assemble_visibility
 #endif

+#undef TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY
+#define TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY
rs6000_print_patchable_function_entry
+
 #undef TARGET_SET_UP_BY_PROLOGUE
 #define TARGET_SET_UP_BY_PROLOGUE rs6000_set_up_by_prologue

@@ -14642,6 +14645,30 @@ rs6000_assemble_visibility (tree decl, i
 }
 #endif


+/* Write PATCH_AREA_SIZE NOPs into the asm outfile FILE around a function
+   entry.  If RECORD_P is true and the target supports named sections,
+   the location of the NOPs will be recorded in a special object section
+   called "__patchable_function_entries".  This routine may be called
+   twice per function to put NOPs before and after the function
+   entry.  */
+
+void
+rs6000_print_patchable_function_entry (FILE *file,
+                                      unsigned HOST_WIDE_INT patch_area_size,
+                                      bool record_p)
+{
+  unsigned int flags = SECTION_WRITE | SECTION_RELRO;
+  /* When .opd section is emitted, the function symbol
+     default_print_patchable_function_entry_1 is emitted into the .opd section
+     while the patchable area is emitted into the function section.
+     Don't use SECTION_LINK_ORDER in that case.  */
+  if (!(TARGET_64BIT && DEFAULT_ABI != ABI_ELFv2)
+      && HAVE_GAS_SECTION_LINK_ORDER)
+    flags |= SECTION_LINK_ORDER;
+  default_print_patchable_function_entry_1 (file, patch_area_size, record_p,
+                                           flags);
+}
+

 enum rtx_code
 rs6000_reverse_condition (machine_mode mode, enum rtx_code code)
 {

This will keep using SHF_LINK_ORDER for e.g. powerpc64-linux -m32 where it
seems to work fine,
doesn't touch powerpc64le-linux which seems to be broken for other reasons and
not a regression,
but will essentially (temporarily) disable SECTION_LINK_ORDER for the case that
regressed,
i.e. when rs6000_elf_declare_function_name emits .opd section and the function
symbol in it.
This would mean that for GCC11 powerpc64-linux -fpatchable-function-entry*
would keep working as before,
which means as long as --gc-sections isn't in effect.
What exactly should be emitted for .opd and "awo" as the symbol is something
I'd defer to Alan and H.J.,
but with this patch it could be handled for GCC12.

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2021-03-30 14:10 ` jakub at gcc dot gnu.org
@ 2021-04-03  8:04 ` cvs-commit at gcc dot gnu.org
  2021-04-03  8:16 ` jakub at gcc dot gnu.org
  20 siblings, 0 replies; 22+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-03  8:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

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

commit r11-7968-gb680b9049737198d010e49cf434704c6a6ed2b3f
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Apr 3 10:03:15 2021 +0200

    rs6000: Avoid -fpatchable-function-entry* regressions on powerpc64 be
[PR98125]

    The SECTION_LINK_ORDER changes broke powerpc64-linux ELFv1.  Seems
    that the assembler/linker relies on the symbol mentioned for the
    "awo" section to be in the same section as the symbols mentioned in
    the relocations in that section (i.e. labels for the patchable area
    in this case).  That is the case for most targets, including powerpc-linux
    32-bit or powerpc64 ELFv2 (that one has -fpatchable-function-entry*
    support broken for other reasons and it doesn't seem to be a regression).
    But it doesn't work on powerpc64-linux ELFv1.
    We emit:
            .section        ".opd","aw"
            .align 3
    _Z3foov:
            .quad   .L._Z3foov,.TOC.@tocbase,0
            .previous
            .type   _Z3foov, @function
    .L._Z3foov:
            .section       
__patchable_function_entries,"awo",@progbits,_Z3foov
            .align 3
            .8byte  .LPFE1
            .section        .text._Z3foov,"axG",@progbits,_Z3foov,comdat
    .LPFE1:
            nop
    .LFB0:
            .cfi_startproc
    and because _Z3foov is in the .opd section rather than the function text
    section, it doesn't work.

    I'm afraid I don't know what exactly should be done, whether e.g.
    it could use
            .section       
__patchable_function_entries,"awo",@progbits,.L._Z3foov
    instead, or whether the linker should be changed to handle it as is, or
    something else.

    But because we have a P1 regression that didn't see useful progress over
the
    4 months since it has been filed and we don't really have much time, below
    is an attempt to do a targetted reversion of H.J's patch, basically act as
    if HAVE_GAS_SECTION_LINK_ORDER is never true for powerpc64-linux ELFv1,
    but for 32-bit or 64-bit ELFv2 keep working as is.
    This would give us time to resolve it for GCC 12 properly.

    2021-04-03  Jakub Jelinek  <jakub@redhat.com>

            PR testsuite/98125
            * targhooks.h (default_print_patchable_function_entry_1): Declare.
            * targhooks.c (default_print_patchable_function_entry_1): New
function,
            copied from default_print_patchable_function_entry with an added
flags
            argument.
            (default_print_patchable_function_entry): Rewritten into a small
            wrapper around default_print_patchable_function_entry_1.
            * config/rs6000/rs6000.c
(TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY):
            Redefine.
            (rs6000_print_patchable_function_entry): New function.

            * g++.dg/pr93195a.C: Skip on powerpc*-*-* 64-bit.

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

* [Bug testsuite/98125] [11 Regression] New test case g++.dg/pr93195a.C in r11-5656 has excess errors
  2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2021-04-03  8:04 ` cvs-commit at gcc dot gnu.org
@ 2021-04-03  8:16 ` jakub at gcc dot gnu.org
  20 siblings, 0 replies; 22+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-03  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #20 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Regression is now fixed.  Clones filed for GCC 12.

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

end of thread, other threads:[~2021-04-03  8:16 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 16:31 [Bug testsuite/98125] New: New test case g++.dg/pr93195a.C in r11-5656 has excess errors seurer at gcc dot gnu.org
2020-12-03 16:36 ` [Bug testsuite/98125] " hjl.tools at gmail dot com
2020-12-03 16:56 ` seurer at gcc dot gnu.org
2020-12-03 18:20 ` hjl.tools at gmail dot com
2020-12-03 20:18 ` hjl.tools at gmail dot com
2020-12-04  6:09 ` amodra at gmail dot com
2020-12-04  7:11 ` [Bug testsuite/98125] [11 Regression] " rguenth at gcc dot gnu.org
2020-12-04 12:00 ` amodra at gmail dot com
2020-12-07 21:45 ` amodra at gmail dot com
2021-01-14 11:01 ` rguenth at gcc dot gnu.org
2021-01-22 15:16 ` jakub at gcc dot gnu.org
2021-01-22 21:05 ` seurer at gcc dot gnu.org
2021-01-22 22:13 ` amodra at gmail dot com
2021-01-22 22:18 ` amodra at gmail dot com
2021-02-12 15:13 ` jakub at gcc dot gnu.org
2021-02-16  1:07 ` amodra at gmail dot com
2021-02-23 15:29 ` jakub at gcc dot gnu.org
2021-02-23 15:32 ` jakub at gcc dot gnu.org
2021-03-30 13:02 ` jakub at gcc dot gnu.org
2021-03-30 14:10 ` jakub at gcc dot gnu.org
2021-04-03  8:04 ` cvs-commit at gcc dot gnu.org
2021-04-03  8:16 ` jakub 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).