public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795
@ 2021-03-08 13:57 ibuclaw at gdcproject dot org
  2021-03-08 14:15 ` [Bug ipa/99466] " marxin at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ibuclaw at gdcproject dot org @ 2021-03-08 13:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99466
           Summary: internal compiler error: in
                    function_and_variable_visibility, at
                    ipa-visibility.c:795
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

Reproduced on x86_64-apple-darwin10, but I expect all targets that depend on
emutls to be affected.

__attribute__((weak)) __thread int tlsvar = 3;

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

* [Bug ipa/99466] internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795
  2021-03-08 13:57 [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 ibuclaw at gdcproject dot org
@ 2021-03-08 14:15 ` marxin at gcc dot gnu.org
  2021-03-08 14:19 ` ibuclaw at gdcproject dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-03-08 14:15 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2021-03-08
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
What compiler options do you use?

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

* [Bug ipa/99466] internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795
  2021-03-08 13:57 [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 ibuclaw at gdcproject dot org
  2021-03-08 14:15 ` [Bug ipa/99466] " marxin at gcc dot gnu.org
@ 2021-03-08 14:19 ` ibuclaw at gdcproject dot org
  2021-03-08 14:35 ` ibuclaw at gdcproject dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ibuclaw at gdcproject dot org @ 2021-03-08 14:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
(In reply to Martin Liška from comment #1)
> What compiler options do you use?
No compiler options are necessary to reproduce the ICE.  The symbol it fails on
is ___emutls_t.tlsvar.

Having a look at where this variable is created, it looks like TREE_PUBLIC is
copied for DECL_ONE_ONLY symbols, but not DECL_WEAK.

--- a/gcc/tree-emutls.c
+++ b/gcc/tree-emutls.c
@@ -242,16 +242,18 @@ get_emutls_init_templ_addr (tree decl)
   DECL_PRESERVE_P (to) = DECL_PRESERVE_P (decl);

   DECL_WEAK (to) = DECL_WEAK (decl);
-  if (DECL_ONE_ONLY (decl))
+  if (DECL_ONE_ONLY (decl) || DECL_WEAK (decl))
     {
       TREE_STATIC (to) = TREE_STATIC (decl);
       TREE_PUBLIC (to) = TREE_PUBLIC (decl);
       DECL_VISIBILITY (to) = DECL_VISIBILITY (decl);
-      make_decl_one_only (to, DECL_ASSEMBLER_NAME (to));
     }
   else
     TREE_STATIC (to) = 1;

+  if (DECL_ONE_ONLY (decl))
+    make_decl_one_only (to, DECL_ASSEMBLER_NAME (to));
+
   DECL_VISIBILITY_SPECIFIED (to) = DECL_VISIBILITY_SPECIFIED (decl);
   DECL_INITIAL (to) = DECL_INITIAL (decl);
   DECL_INITIAL (decl) = NULL;

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

* [Bug ipa/99466] internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795
  2021-03-08 13:57 [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 ibuclaw at gdcproject dot org
  2021-03-08 14:15 ` [Bug ipa/99466] " marxin at gcc dot gnu.org
  2021-03-08 14:19 ` ibuclaw at gdcproject dot org
@ 2021-03-08 14:35 ` ibuclaw at gdcproject dot org
  2021-03-16 13:28 ` iains at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ibuclaw at gdcproject dot org @ 2021-03-08 14:35 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Buclaw <ibuclaw at gdcproject dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |8.4.0

--- Comment #3 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
Oldest compiler version have tried it one is 8.4.0, and there's an ICE there as
well.

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

* [Bug ipa/99466] internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795
  2021-03-08 13:57 [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 ibuclaw at gdcproject dot org
                   ` (2 preceding siblings ...)
  2021-03-08 14:35 ` ibuclaw at gdcproject dot org
@ 2021-03-16 13:28 ` iains at gcc dot gnu.org
  2021-03-16 14:15 ` ibuclaw at gdcproject dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: iains at gcc dot gnu.org @ 2021-03-16 13:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2021-03-08 00:00:00         |2021-3-16
             Status|WAITING                     |NEW

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Buclaw from comment #3)
> Oldest compiler version have tried it one is 8.4.0, and there's an ICE there
> as well.

On Darwin16 : ICE back to 5.5, at least (probably, it never worked - I will see
if can find a 4.x compiler on an older box)

I don't see any specific reason for this to be "waiting" now.

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

* [Bug ipa/99466] internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795
  2021-03-08 13:57 [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 ibuclaw at gdcproject dot org
                   ` (3 preceding siblings ...)
  2021-03-16 13:28 ` iains at gcc dot gnu.org
@ 2021-03-16 14:15 ` ibuclaw at gdcproject dot org
  2021-03-16 14:19 ` iains at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ibuclaw at gdcproject dot org @ 2021-03-16 14:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
(In reply to Iain Sandoe from comment #4)
> (In reply to Iain Buclaw from comment #3)
> > Oldest compiler version have tried it one is 8.4.0, and there's an ICE there
> > as well.
> 
> On Darwin16 : ICE back to 5.5, at least (probably, it never worked - I will
> see if can find a 4.x compiler on an older box)
> 
> I don't see any specific reason for this to be "waiting" now.
The system installed compiler (4.2.1) errors with "thread-local storage not
supported for this target", so yes, I think you're right.

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

* [Bug ipa/99466] internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795
  2021-03-08 13:57 [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 ibuclaw at gdcproject dot org
                   ` (4 preceding siblings ...)
  2021-03-16 14:15 ` ibuclaw at gdcproject dot org
@ 2021-03-16 14:19 ` iains at gcc dot gnu.org
  2021-03-26 15:15 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: iains at gcc dot gnu.org @ 2021-03-16 14:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Buclaw from comment #5)
> (In reply to Iain Sandoe from comment #4)
> > (In reply to Iain Buclaw from comment #3)
> > > Oldest compiler version have tried it one is 8.4.0, and there's an ICE there
> > > as well.
> > 
> > On Darwin16 : ICE back to 5.5, at least (probably, it never worked - I will
> > see if can find a 4.x compiler on an older box)
> > 
> > I don't see any specific reason for this to be "waiting" now.
> The system installed compiler (4.2.1) errors with "thread-local storage not
> supported for this target", so yes, I think you're right.

emuTLS was introduced sometime in 4.x (RTH made the implementation), it did not
exist for Apple-4.x, native TLS was introduced in clang for Darwin11 (but we
don't have that for GCC, yet - with an open PR for that).

for the record the emuTLS test ICEs back to at least 4.6.4 on Darwin9.

Given that this is ice-on-valid, IMO we should consider fixing on the open
branches.

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

* [Bug ipa/99466] internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795
  2021-03-08 13:57 [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 ibuclaw at gdcproject dot org
                   ` (5 preceding siblings ...)
  2021-03-16 14:19 ` iains at gcc dot gnu.org
@ 2021-03-26 15:15 ` cvs-commit at gcc dot gnu.org
  2021-03-26 15:44 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-26 15:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:8f5e18db259c8a9790feb1d73bb0348182264f15

commit r11-7849-g8f5e18db259c8a9790feb1d73bb0348182264f15
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Sat Mar 13 17:05:52 2021 +0100

    Fix ICE: in function_and_variable_visibility, at ipa-visibility.c:795
[PR99466]

    In get_emutls_init_templ_addr, only thread-local declarations that were
    DECL_ONE_ONLY would have a public initializer symbol, ignoring variables
    that were declared with __attribute__((weak)).

    gcc/ChangeLog:

            PR ipa/99466
            * tree-emutls.c (get_emutls_init_templ_addr): Mark initializer of
weak
            TLS declarations as public.

    gcc/testsuite/ChangeLog:

            PR ipa/99466
            * gcc.dg/tls/pr99466-1.c: New test.
            * gcc.dg/tls/pr99466-2.c: New test.

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

* [Bug ipa/99466] internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795
  2021-03-08 13:57 [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 ibuclaw at gdcproject dot org
                   ` (6 preceding siblings ...)
  2021-03-26 15:15 ` cvs-commit at gcc dot gnu.org
@ 2021-03-26 15:44 ` cvs-commit at gcc dot gnu.org
  2021-03-26 15:45 ` cvs-commit at gcc dot gnu.org
  2021-03-26 15:46 ` ibuclaw at gdcproject dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-26 15:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Iain Buclaw
<ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:1df9bfdd24388adccdb6a07eda6161ef6626dac5

commit r10-9547-g1df9bfdd24388adccdb6a07eda6161ef6626dac5
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Sat Mar 13 17:05:52 2021 +0100

    Fix ICE: in function_and_variable_visibility, at ipa-visibility.c:795
[PR99466]

    In get_emutls_init_templ_addr, only thread-local declarations that were
    DECL_ONE_ONLY would have a public initializer symbol, ignoring variables
    that were declared with __attribute__((weak)).

    gcc/ChangeLog:

            PR ipa/99466
            * tree-emutls.c (get_emutls_init_templ_addr): Mark initializer of
weak
            TLS declarations as public.

    gcc/testsuite/ChangeLog:

            PR ipa/99466
            * gcc.dg/tls/pr99466-1.c: New test.
            * gcc.dg/tls/pr99466-2.c: New test.

    (cherry picked from commit 8f5e18db259c8a9790feb1d73bb0348182264f15)

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

* [Bug ipa/99466] internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795
  2021-03-08 13:57 [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 ibuclaw at gdcproject dot org
                   ` (7 preceding siblings ...)
  2021-03-26 15:44 ` cvs-commit at gcc dot gnu.org
@ 2021-03-26 15:45 ` cvs-commit at gcc dot gnu.org
  2021-03-26 15:46 ` ibuclaw at gdcproject dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-26 15:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Iain Buclaw
<ibuclaw@gcc.gnu.org>:

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

commit r9-9310-gfd23b0bb77d483c07bc14f86cc349f82b1b38320
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Sat Mar 13 17:05:52 2021 +0100

    Fix ICE: in function_and_variable_visibility, at ipa-visibility.c:795
[PR99466]

    In get_emutls_init_templ_addr, only thread-local declarations that were
    DECL_ONE_ONLY would have a public initializer symbol, ignoring variables
    that were declared with __attribute__((weak)).

    gcc/ChangeLog:

            PR ipa/99466
            * tree-emutls.c (get_emutls_init_templ_addr): Mark initializer of
weak
            TLS declarations as public.

    gcc/testsuite/ChangeLog:

            PR ipa/99466
            * gcc.dg/tls/pr99466-1.c: New test.
            * gcc.dg/tls/pr99466-2.c: New test.

    (cherry picked from commit 8f5e18db259c8a9790feb1d73bb0348182264f15)

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

* [Bug ipa/99466] internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795
  2021-03-08 13:57 [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 ibuclaw at gdcproject dot org
                   ` (8 preceding siblings ...)
  2021-03-26 15:45 ` cvs-commit at gcc dot gnu.org
@ 2021-03-26 15:46 ` ibuclaw at gdcproject dot org
  9 siblings, 0 replies; 11+ messages in thread
From: ibuclaw at gdcproject dot org @ 2021-03-26 15:46 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Buclaw <ibuclaw at gdcproject dot org> changed:

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

--- Comment #10 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
Committed, and backported to gcc-10 and gcc-9.

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

end of thread, other threads:[~2021-03-26 15:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 13:57 [Bug c/99466] New: internal compiler error: in function_and_variable_visibility, at ipa-visibility.c:795 ibuclaw at gdcproject dot org
2021-03-08 14:15 ` [Bug ipa/99466] " marxin at gcc dot gnu.org
2021-03-08 14:19 ` ibuclaw at gdcproject dot org
2021-03-08 14:35 ` ibuclaw at gdcproject dot org
2021-03-16 13:28 ` iains at gcc dot gnu.org
2021-03-16 14:15 ` ibuclaw at gdcproject dot org
2021-03-16 14:19 ` iains at gcc dot gnu.org
2021-03-26 15:15 ` cvs-commit at gcc dot gnu.org
2021-03-26 15:44 ` cvs-commit at gcc dot gnu.org
2021-03-26 15:45 ` cvs-commit at gcc dot gnu.org
2021-03-26 15:46 ` ibuclaw at gdcproject dot 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).