public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466
@ 2022-10-21 22:53 seurer at gcc dot gnu.org
  2022-10-21 22:56 ` [Bug other/107353] " seurer at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: seurer at gcc dot gnu.org @ 2022-10-21 22:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107353
           Summary: [13 regression] Numerous ICEs after
                    13-3416-g1d561e1851c466
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:1d561e1851c466a4952081caef17747781609b00, r13-3416-g1d561e1851c466

FAIL: gcc.dg/tls/emutls-3.c (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: gcc.dg/tls/emutls-3.c (test for excess errors)
FAIL: gfortran.dg/gomp/appendix-a/a.22.1.f90   -O  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: gfortran.dg/gomp/appendix-a/a.22.1.f90   -O  (test for excess errors)
FAIL: gfortran.dg/gomp/appendix-a/a.33.1.f90   -O  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: gfortran.dg/gomp/appendix-a/a.33.1.f90   -O  (test for excess errors)
FAIL: libgomp.fortran/omp_parse3.f90   -O0  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/omp_parse3.f90   -O0  (test for excess errors)
FAIL: libgomp.fortran/omp_parse3.f90   -O1  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/omp_parse3.f90   -O1  (test for excess errors)
FAIL: libgomp.fortran/omp_parse3.f90   -O2  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/omp_parse3.f90   -O2  (test for excess errors)
FAIL: libgomp.fortran/omp_parse3.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/omp_parse3.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: libgomp.fortran/omp_parse3.f90   -O3 -g  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/omp_parse3.f90   -O3 -g  (test for excess errors)
FAIL: libgomp.fortran/omp_parse3.f90   -Os  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/omp_parse3.f90   -Os  (test for excess errors)
FAIL: libgomp.fortran/pr25162.f   -O0  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/pr25162.f   -O0  (test for excess errors)
FAIL: libgomp.fortran/pr25162.f   -O1  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/pr25162.f   -O1  (test for excess errors)
FAIL: libgomp.fortran/pr25162.f   -O2  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/pr25162.f   -O2  (test for excess errors)
FAIL: libgomp.fortran/pr25162.f   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/pr25162.f   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: libgomp.fortran/pr25162.f   -O3 -g  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/pr25162.f   -O3 -g  (test for excess errors)
FAIL: libgomp.fortran/pr25162.f   -Os  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/pr25162.f   -Os  (test for excess errors)
FAIL: libgomp.fortran/threadprivate2.f90   -O0  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate2.f90   -O0  (test for excess errors)
FAIL: libgomp.fortran/threadprivate2.f90   -O1  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate2.f90   -O1  (test for excess errors)
FAIL: libgomp.fortran/threadprivate2.f90   -O2  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate2.f90   -O2  (test for excess errors)
FAIL: libgomp.fortran/threadprivate2.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (internal compiler
error: in function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate2.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess
errors)
FAIL: libgomp.fortran/threadprivate2.f90   -O3 -g  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate2.f90   -O3 -g  (test for excess errors)
FAIL: libgomp.fortran/threadprivate2.f90   -Os  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate2.f90   -Os  (test for excess errors)
FAIL: libgomp.fortran/threadprivate3.f90   -O0  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate3.f90   -O0  (test for excess errors)
FAIL: libgomp.fortran/threadprivate3.f90   -O1  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate3.f90   -O1  (test for excess errors)
FAIL: libgomp.fortran/threadprivate3.f90   -O2  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate3.f90   -O2  (test for excess errors)
FAIL: libgomp.fortran/threadprivate3.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (internal compiler
error: in function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate3.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess
errors)
FAIL: libgomp.fortran/threadprivate3.f90   -O3 -g  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate3.f90   -O3 -g  (test for excess errors)
FAIL: libgomp.fortran/threadprivate3.f90   -Os  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate3.f90   -Os  (test for excess errors)
FAIL: libgomp.fortran/threadprivate4.f90   -O0  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate4.f90   -O0  (test for excess errors)
FAIL: libgomp.fortran/threadprivate4.f90   -O1  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate4.f90   -O1  (test for excess errors)
FAIL: libgomp.fortran/threadprivate4.f90   -O2  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate4.f90   -O2  (test for excess errors)
FAIL: libgomp.fortran/threadprivate4.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (internal compiler
error: in function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate4.f90   -O3 -fomit-frame-pointer
-funroll-loops -fpeel-loops -ftracer -finline-functions  (test for excess
errors)
FAIL: libgomp.fortran/threadprivate4.f90   -O3 -g  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate4.f90   -O3 -g  (test for excess errors)
FAIL: libgomp.fortran/threadprivate4.f90   -Os  (internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889)
FAIL: libgomp.fortran/threadprivate4.f90   -Os  (test for excess errors)

spawn -ignore SIGHUP
/home/seurer/gcc/git/build/gcc-test/gcc/testsuite/gfortran1/../../gfortran
-B/home/seurer/gcc/git/build/gcc-test/gcc/testsuite/gfortran1/../../
-B/home/seurer/gcc/git/build/gcc-test/powerpc64le-unknown-linux-gnu/./libgfortran/
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.1.f90
-fdiagnostics-plain-output -fdiagnostics-plain-output -O -fopenmp -S -o
a.22.1.s^M
during IPA pass: whole-program^M
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.22.1.f90:10:36:
internal compiler error: in function_and_variable_visibility, at
ipa-visibility.cc:889^M
0x11db499f function_and_variable_visibility^M
        /home/seurer/gcc/git/gcc-test/gcc/ipa-visibility.cc:889^M
0x11db4ce3 whole_program_function_and_variable_visibility^M
        /home/seurer/gcc/git/gcc-test/gcc/ipa-visibility.cc:940^M
0x11db4ce3 execute^M
        /home/seurer/gcc/git/gcc-test/gcc/ipa-visibility.cc:988^M


commit 1d561e1851c466a4952081caef17747781609b00 (HEAD, refs/bisect/bad)
Author: Artem Klimov <jakmobius@gmail.com>
Date:   Wed Jul 6 17:02:01 2022 +0300

    ipa-visibility: Optimize TLS access [PR99619]

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

* [Bug other/107353] [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
@ 2022-10-21 22:56 ` seurer at gcc dot gnu.org
  2022-10-21 23:30 ` law at gcc dot gnu.org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: seurer at gcc dot gnu.org @ 2022-10-21 22:56 UTC (permalink / raw)
  To: gcc-bugs

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

seurer at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Build|                            |powerpc64le-linux-gnu
                 CC|                            |bergner at gcc dot gnu.org,
                   |                            |segher at gcc dot gnu.org
             Target|                            |powerpc64le-linux-gnu
               Host|                            |powerpc64le-linux-gnu

--- Comment #1 from seurer at gcc dot gnu.org ---
Note that I wasn't able to figure out a usable email address for the submitter.

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

* [Bug other/107353] [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
  2022-10-21 22:56 ` [Bug other/107353] " seurer at gcc dot gnu.org
@ 2022-10-21 23:30 ` law at gcc dot gnu.org
  2022-10-22  8:49 ` [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466 iains at gcc dot gnu.org
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: law at gcc dot gnu.org @ 2022-10-21 23:30 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-10-21
                 CC|                            |law at gcc dot gnu.org

--- Comment #2 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Note this is also failing on embedded targets.  For example nds32le-elf is
failing emutls-3.c with an ICE.

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
  2022-10-21 22:56 ` [Bug other/107353] " seurer at gcc dot gnu.org
  2022-10-21 23:30 ` law at gcc dot gnu.org
@ 2022-10-22  8:49 ` iains at gcc dot gnu.org
  2022-10-22 11:17 ` iains at gcc dot gnu.org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: iains at gcc dot gnu.org @ 2022-10-22  8:49 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
               Host|powerpc64le-linux-gnu       |powerpc64le-linux-gnu,*-*-d
                   |                            |arwin*
                 CC|                            |iains at gcc dot gnu.org
              Build|powerpc64le-linux-gnu       |powerpc64le-linux-gnu,*-*-d
                   |                            |arwin*
             Target|powerpc64le-linux-gnu       |powerpc64le-linux-gnu,*-*-d
                   |                            |arwin*

--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
also on Darwin (and as per Jeff's comment, probably all other emulated TLS
targets).

likely also on any other non-ELF target?

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-10-22  8:49 ` [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466 iains at gcc dot gnu.org
@ 2022-10-22 11:17 ` iains at gcc dot gnu.org
  2022-10-24 13:00 ` rguenth at gcc dot gnu.org
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: iains at gcc dot gnu.org @ 2022-10-22 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
Emulated TLS targets can test targetm.have_tls.

The patch below fixes the fails on Fortran for x86_64-darwin, libgomp in test
now.

I do not really like that it means pulling in the whole of target.h, and
imagine that this will not fix the powerpc64le-linux-gnu cases?

The TLS varieties are "ELF" (AFAIU).. so this would not fix things if/when I
implement native TLS on Darwin (since that has Mach-O semantics for TLS).

so, perhaps there's a better test (or we should make the targetm test more
fine-grained).  In any event we should not test things that pertain to the
platform in the inner loop - but either punt on the whole opt (or choose a
different flavour) for other targets.


diff --git a/gcc/ipa-visibility.cc b/gcc/ipa-visibility.cc
index 3ed2b7cf679..acea49f8b1f 100644
--- a/gcc/ipa-visibility.cc
+++ b/gcc/ipa-visibility.cc
@@ -86,6 +86,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-utils.h"
 #include "stringpool.h"
 #include "attribs.h"
+#include "target.h"

 /* Return true when NODE cannot be local. Worker for cgraph_local_node_p.  */

@@ -873,7 +874,7 @@ function_and_variable_visibility (bool whole_program)
        }
     }

-  if (symtab->state >= IPA_SSA)
+  if (symtab->state >= IPA_SSA && targetm.have_tls)
     {
       FOR_EACH_VARIABLE (vnode)
        {

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-10-22 11:17 ` iains at gcc dot gnu.org
@ 2022-10-24 13:00 ` rguenth at gcc dot gnu.org
  2022-10-24 20:42 ` segher at gcc dot gnu.org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-24 13:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
           Priority|P3                          |P1

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-10-24 13:00 ` rguenth at gcc dot gnu.org
@ 2022-10-24 20:42 ` segher at gcc dot gnu.org
  2022-10-25  6:43 ` amonakov at gcc dot gnu.org
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: segher at gcc dot gnu.org @ 2022-10-24 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> ---
Please revert until it is fixed?  It breaks way too many targets.

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-10-24 20:42 ` segher at gcc dot gnu.org
@ 2022-10-25  6:43 ` amonakov at gcc dot gnu.org
  2022-10-25  6:54 ` asolokha at gmx dot com
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: amonakov at gcc dot gnu.org @ 2022-10-25  6:43 UTC (permalink / raw)
  To: gcc-bugs

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

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

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

--- Comment #6 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
I can start investigating the root cause later today. In the meantime, please
supply the usual reproduction info if possible (configure arguments and
preprocessed source where applicable).

Presumably powerpc64le doesn't use emutls, so there might be two issues.

FWIW, I don't understand why I was not Cc'ed on this bug, especially if adding
the main author turned out to be a problem. The commit message gives my email
twice, as a co-author and as the committer, and it's conveniently hyperlinked
from comment 0.

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2022-10-25  6:43 ` amonakov at gcc dot gnu.org
@ 2022-10-25  6:54 ` asolokha at gmx dot com
  2022-10-25  7:00 ` amonakov at gcc dot gnu.org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: asolokha at gmx dot com @ 2022-10-25  6:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Arseny Solokha <asolokha at gmx dot com> ---
(In reply to Alexander Monakov from comment #6)
> Presumably powerpc64le doesn't use emutls, so there might be two issues.

I have it on x86_64-pc-linux-gnu…

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2022-10-25  6:54 ` asolokha at gmx dot com
@ 2022-10-25  7:00 ` amonakov at gcc dot gnu.org
  2022-10-25  7:11 ` amonakov at gcc dot gnu.org
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: amonakov at gcc dot gnu.org @ 2022-10-25  7:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
(In reply to Arseny Solokha from comment #7)
> I have it on x86_64-pc-linux-gnu…

Thanks for the info (I assume you don't have any special configure arguments),
but that's surprising, I ran bootstrap+regtest before committing the patch, and
did not see such issues. I'll recheck with today's trunk.

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2022-10-25  7:00 ` amonakov at gcc dot gnu.org
@ 2022-10-25  7:11 ` amonakov at gcc dot gnu.org
  2022-10-25  7:49 ` asolokha at gmx dot com
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: amonakov at gcc dot gnu.org @ 2022-10-25  7:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Actually, latest results from H.J. Lu's periodic x86_64 tester don't exhibit
such issues either:
https://inbox.sourceware.org/gcc-testresults/20221025065901.6DC00622CC@gnu-34.sc.intel.com/T/#u

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2022-10-25  7:11 ` amonakov at gcc dot gnu.org
@ 2022-10-25  7:49 ` asolokha at gmx dot com
  2022-10-25 14:11 ` amonakov at gcc dot gnu.org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: asolokha at gmx dot com @ 2022-10-25  7:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Arseny Solokha <asolokha at gmx dot com> ---
g++ 13.0.0 20221023 snapshot (g:0e37fd4dc74c1db99cdc7d71ef378e1221253c6f) ICEs
when compiling the following testcase, reduced from
test/CodeGenCXX/cxx11-thread-local.cpp from the clang 14 test suite:

struct Dtor;
template <typename> struct X { static thread_local Dtor m; };
template <typename T> thread_local Dtor X<T>::m;
extern template Dtor X<char>::m;
void *e2 = &X<char>::m;

% x86_64-pc-linux-gnu-g++-13 -c uuir2io5.cpp
during IPA pass: whole-program
uuir2io5.cpp:5:23: internal compiler error: in
function_and_variable_visibility, at ipa-visibility.cc:889
    5 | void *e2 = &X<char>::m;
      |                       ^
0x9403cc function_and_variable_visibility
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/ipa-visibility.cc:889
0x20fe8a6 whole_program_function_and_variable_visibility
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/ipa-visibility.cc:940
0x20fe8a6 execute
       
/var/tmp/portage/sys-devel/gcc-13.0.0_p20221023/work/gcc-13-20221023/gcc/ipa-visibility.cc:988

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2022-10-25  7:49 ` asolokha at gmx dot com
@ 2022-10-25 14:11 ` amonakov at gcc dot gnu.org
  2022-10-25 16:08 ` amonakov at gcc dot gnu.org
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: amonakov at gcc dot gnu.org @ 2022-10-25 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
I've broken out the C++ issue from comment #10 as PR 107393, thanks for the
testcase. It's a separate issue from emutls and Fortran ICEs on other targets.

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2022-10-25 14:11 ` amonakov at gcc dot gnu.org
@ 2022-10-25 16:08 ` amonakov at gcc dot gnu.org
  2022-10-25 17:51 ` amonakov at gcc dot gnu.org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: amonakov at gcc dot gnu.org @ 2022-10-25 16:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
ICE on the emutls-3.c testcase isn't related to emutls. Rather, the frontend
invokes decl_default_tls_model before attributes are processed, so the first
time around we miss the 'common' attribute when deciding the TLS access model.

The following cut-down testcase fails on x86 as well with -m32 -fpie:

__attribute__((common))
__thread int i;

int *f()
{
        return &i;
}

Before the offending commit GCC compiled 'f' as if the attribute was ignored.
(on ELF targets combining TLS and COMMON is problematic if not undefined)

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2022-10-25 16:08 ` amonakov at gcc dot gnu.org
@ 2022-10-25 17:51 ` amonakov at gcc dot gnu.org
  2022-10-26 16:30 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: amonakov at gcc dot gnu.org @ 2022-10-25 17:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
As for the Fortran testcases, the issue is again caused by the front-end
invoking decl_default_tls_model before assigning DECL_COMMON, this time in
fortran/trans-common.cc:build_common_decl.

So I guess I can be happy that the assert uncovered issues in three front-ends,
and adjust the code to avoid downgrading TLS model instead of asserting:

diff --git a/gcc/ipa-visibility.cc b/gcc/ipa-visibility.cc
index 3ed2b7cf6..bb86005e5 100644
--- a/gcc/ipa-visibility.cc
+++ b/gcc/ipa-visibility.cc
@@ -886,8 +886,8 @@ function_and_variable_visibility (bool whole_program)
              && vnode->ref_list.referring.length ())
            {
              enum tls_model new_model = decl_default_tls_model (decl);
-             gcc_checking_assert (new_model >= decl_tls_model (decl));
-             set_decl_tls_model (decl, new_model);
+             if (new_model >= decl_tls_model (decl))
+               set_decl_tls_model (decl, new_model);
            }
        }
     }

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

* [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2022-10-25 17:51 ` amonakov at gcc dot gnu.org
@ 2022-10-26 16:30 ` cvs-commit at gcc dot gnu.org
  2022-10-26 17:02 ` [Bug other/107353] frontends sometimes select wrong (too strong) TLS access model amonakov at gcc dot gnu.org
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-26 16:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alexander Monakov <amonakov@gcc.gnu.org>:

https://gcc.gnu.org/g:82e629c26647313be406c41a01e6868cfad0f289

commit r13-3509-g82e629c26647313be406c41a01e6868cfad0f289
Author: Alexander Monakov <amonakov@ispras.ru>
Date:   Wed Oct 26 16:37:34 2022 +0300

    ipa-visibility: remove assert in TLS optimization [PR107353]

    When upgrading TLS access model based on optimized symbol visibility
    status, we attempted to assert that recomputing the model would not
    weaken it. It turns out that C, C++, and Fortran front-ends all can
    (unintentionally) assign a stronger model than what can be derived
    from the declaration.

    Let's act conservatively instead of asserting, at least as long as
    such pre-existing issues remain.

    gcc/ChangeLog:

            PR other/107353
            * ipa-visibility.cc (function_and_variable_visibility):
            Conditionally upgrade TLS model instead of asserting.

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

* [Bug other/107353] frontends sometimes select wrong (too strong) TLS access model
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2022-10-26 16:30 ` cvs-commit at gcc dot gnu.org
@ 2022-10-26 17:02 ` amonakov at gcc dot gnu.org
  2023-04-26  6:56 ` rguenth at gcc dot gnu.org
  2023-07-27  9:24 ` rguenth at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: amonakov at gcc dot gnu.org @ 2022-10-26 17:02 UTC (permalink / raw)
  To: gcc-bugs

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

Alexander Monakov <amonakov at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[13 regression] Numerous    |frontends sometimes select
                   |ICEs after                  |wrong (too strong) TLS
                   |r13-3416-g1d561e1851c466    |access model

--- Comment #15 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
C FE issue was broken out as PR 107419 and Fortran FE issue as PR 107421, which
now "block" this PR together with PR 107393 for the earlier C++ testcase. The
offending assert is gone, so retitling (not a regression anymore).

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

* [Bug other/107353] frontends sometimes select wrong (too strong) TLS access model
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2022-10-26 17:02 ` [Bug other/107353] frontends sometimes select wrong (too strong) TLS access model amonakov at gcc dot gnu.org
@ 2023-04-26  6:56 ` rguenth at gcc dot gnu.org
  2023-07-27  9:24 ` rguenth at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-26  6:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.0                        |13.2

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 13.1 is being released, retargeting bugs to GCC 13.2.

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

* [Bug other/107353] frontends sometimes select wrong (too strong) TLS access model
  2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2023-04-26  6:56 ` rguenth at gcc dot gnu.org
@ 2023-07-27  9:24 ` rguenth at gcc dot gnu.org
  17 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-27  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.2                        |13.3

--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 13.2 is being released, retargeting bugs to GCC 13.3.

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

end of thread, other threads:[~2023-07-27  9:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21 22:53 [Bug other/107353] New: [13 regression] Numerous ICEs after 13-3416-g1d561e1851c466 seurer at gcc dot gnu.org
2022-10-21 22:56 ` [Bug other/107353] " seurer at gcc dot gnu.org
2022-10-21 23:30 ` law at gcc dot gnu.org
2022-10-22  8:49 ` [Bug other/107353] [13 regression] Numerous ICEs after r13-3416-g1d561e1851c466 iains at gcc dot gnu.org
2022-10-22 11:17 ` iains at gcc dot gnu.org
2022-10-24 13:00 ` rguenth at gcc dot gnu.org
2022-10-24 20:42 ` segher at gcc dot gnu.org
2022-10-25  6:43 ` amonakov at gcc dot gnu.org
2022-10-25  6:54 ` asolokha at gmx dot com
2022-10-25  7:00 ` amonakov at gcc dot gnu.org
2022-10-25  7:11 ` amonakov at gcc dot gnu.org
2022-10-25  7:49 ` asolokha at gmx dot com
2022-10-25 14:11 ` amonakov at gcc dot gnu.org
2022-10-25 16:08 ` amonakov at gcc dot gnu.org
2022-10-25 17:51 ` amonakov at gcc dot gnu.org
2022-10-26 16:30 ` cvs-commit at gcc dot gnu.org
2022-10-26 17:02 ` [Bug other/107353] frontends sometimes select wrong (too strong) TLS access model amonakov at gcc dot gnu.org
2023-04-26  6:56 ` rguenth at gcc dot gnu.org
2023-07-27  9:24 ` rguenth 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).