public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/49316] New: ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C
@ 2011-06-07 17:42 ro at gcc dot gnu.org
  2011-07-19 14:12 ` [Bug tree-optimization/49316] " ro at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ro at gcc dot gnu.org @ 2011-06-07 17:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49316

           Summary: ICE in in function_and_variable_visibility, at
                    ipa.c:926 with g++.dg/tls/diag-1.C
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ro@gcc.gnu.org
                CC: hubicka@gcc.gnu.org
              Host: alpha-dec-osf5.1b
            Target: alpha-dec-osf5.1b
             Build: alpha-dec-osf5.1b


g++.dg/tls/diag-1.C FAILs on Tru64 UNIX:

FAIL: g++.dg/tls/diag-1.C (internal compiler error)
FAIL: g++.dg/tls/diag-1.C (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/osf/gcc/testsuite/g++.dg/tls/diag-1.C:31:1: internal
compiler error: in function_and_variable_visibility, at ipa.c:926


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

* [Bug tree-optimization/49316] ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C
  2011-06-07 17:42 [Bug tree-optimization/49316] New: ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C ro at gcc dot gnu.org
@ 2011-07-19 14:12 ` ro at gcc dot gnu.org
  2011-10-25 20:04 ` greed at pobox dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ro at gcc dot gnu.org @ 2011-07-19 14:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49316

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.07.19 14:12:10
     Ever Confirmed|0                           |1

--- Comment #1 from Rainer Orth <ro at gcc dot gnu.org> 2011-07-19 14:12:10 UTC ---
Still happens as of 20110715:

$ cc1plus -quiet -fpreprocessed g++.dg/tls/diag-1.C
g++.dg/tls/diag-1.C:31:1: internal compiler error: in
function_and_variable_visibility, at ipa.c:887

Jan, any idea?

Thanks.
  Rainer


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

* [Bug tree-optimization/49316] ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C
  2011-06-07 17:42 [Bug tree-optimization/49316] New: ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C ro at gcc dot gnu.org
  2011-07-19 14:12 ` [Bug tree-optimization/49316] " ro at gcc dot gnu.org
@ 2011-10-25 20:04 ` greed at pobox dot com
  2011-10-26  9:23 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: greed at pobox dot com @ 2011-10-25 20:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49316

Graham Reed <greed at pobox dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greed at pobox dot com

--- Comment #2 from Graham Reed <greed at pobox dot com> 2011-10-25 20:04:32 UTC ---
This may be the same fault I'm seeing on AIX with GCC 4.6.1--does Tru64 use an
"emulated TLS" as well?

I reduced diag-1.C to this:

template <typename T> struct B { static __thread T t; };
template <typename T> __thread T B<T>::t = 42;
void bar () { int j = B<int>::t; }

If it is the same fault, what's happening is, a weak, public reference is being
created for the TLS emulation template for B<int>::t.  When it is used to
initialize j, the public flag is cleared--it's local, after all.  (This is in
tree-emutls.c at lines 238 to 247 in both 4.6.1 and SVN revision 180430.)

But the assertion in ipa.c "knows" anything weak must be either public or
extern--that's the error in the ICE message.

I don't know if the error is in clearing the 'public' flag, or in assuming
everything weak is public or extern.

Note I haven't yet gotten the trunk code to build; we've got a bit of a
shortage of AIX horsepower.  As there are trunk changes in both ipa.c and
tree-emutls.c, it is possible AIX is fine with trunk but Tru64 still has
issues.


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

* [Bug tree-optimization/49316] ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C
  2011-06-07 17:42 [Bug tree-optimization/49316] New: ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C ro at gcc dot gnu.org
  2011-07-19 14:12 ` [Bug tree-optimization/49316] " ro at gcc dot gnu.org
  2011-10-25 20:04 ` greed at pobox dot com
@ 2011-10-26  9:23 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2011-10-26 15:37 ` greed at pobox dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2011-10-26  9:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49316

--- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> 2011-10-26 09:22:41 UTC ---
> --- Comment #2 from Graham Reed <greed at pobox dot com> 2011-10-25 20:04:32 UTC ---
> This may be the same fault I'm seeing on AIX with GCC 4.6.1--does Tru64 use an
> "emulated TLS" as well?

It does: while the platform could support native TLS, it is so different
from the usual ELF implementations that it hasn't been implemented in gcc.

> I reduced diag-1.C to this:
>
> template <typename T> struct B { static __thread T t; };
> template <typename T> __thread T B<T>::t = 42;
> void bar () { int j = B<int>::t; }

I get the same ICE on that testcase with trunk as of r180287.

    Rainer


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

* [Bug tree-optimization/49316] ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C
  2011-06-07 17:42 [Bug tree-optimization/49316] New: ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-10-26  9:23 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2011-10-26 15:37 ` greed at pobox dot com
  2011-10-26 15:40 ` greed at pobox dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: greed at pobox dot com @ 2011-10-26 15:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49316

--- Comment #4 from Graham Reed <greed at pobox dot com> 2011-10-26 15:36:40 UTC ---
Created attachment 25617
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25617
KLUDGE/workaround for ICE

I worked around the ICE on AIX with this patch.  THIS IS A WORKAROUND ONLY--I
do not know the code anywhere near well enough to believe this is a correct
fix.

It changes tree-emutls.c so that a weak symbol remains public, which then lets
it go through the assert in ipa.c.


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

* [Bug tree-optimization/49316] ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C
  2011-06-07 17:42 [Bug tree-optimization/49316] New: ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C ro at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-10-26 15:37 ` greed at pobox dot com
@ 2011-10-26 15:40 ` greed at pobox dot com
  2011-10-26 15:52 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: greed at pobox dot com @ 2011-10-26 15:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49316

--- Comment #5 from Graham Reed <greed at pobox dot com> 2011-10-26 15:39:10 UTC ---
(In reply to comment #4)

Sorry, forgot to add:

I made the patch against 4.6.1, and have run bootstrap and testing on AIX 5.3
TL4.  I was able to apply it unchanged against trunk r180430, but have not yet
gotten through a build of that source.


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

* [Bug tree-optimization/49316] ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C
  2011-06-07 17:42 [Bug tree-optimization/49316] New: ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C ro at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-10-26 15:40 ` greed at pobox dot com
@ 2011-10-26 15:52 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2011-10-28 17:18 ` greed at pobox dot com
  2015-02-13  0:22 ` rth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2011-10-26 15:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49316

--- Comment #6 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> 2011-10-26 15:52:07 UTC ---
> I made the patch against 4.6.1, and have run bootstrap and testing on AIX 5.3
> TL4.  I was able to apply it unchanged against trunk r180430, but have not yet
> gotten through a build of that source.

I've just done a quick rebuild of tree-emutls.o and cc1plus on Tru64
UNIX V5.1B, and now I can successfully compile both your minimized
testcase and g++.dg/tls/diag-1.C passes as well.

Thanks.
        Rainer


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

* [Bug tree-optimization/49316] ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C
  2011-06-07 17:42 [Bug tree-optimization/49316] New: ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C ro at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-10-26 15:52 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2011-10-28 17:18 ` greed at pobox dot com
  2015-02-13  0:22 ` rth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: greed at pobox dot com @ 2011-10-28 17:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49316

--- Comment #7 from Graham Reed <greed at pobox dot com> 2011-10-28 17:17:54 UTC ---
I've now gotten the trunk (SVN 180430) built on AIX 5.3 TL4; the problem is the
same as 4.6.1 and is also "solved" with the same patch.

So this is definitely not target-specific, it seems to be in the emulated TLS.


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

* [Bug tree-optimization/49316] ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C
  2011-06-07 17:42 [Bug tree-optimization/49316] New: ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C ro at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-10-28 17:18 ` greed at pobox dot com
@ 2015-02-13  0:22 ` rth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rth at gcc dot gnu.org @ 2015-02-13  0:22 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Henderson <rth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|alpha-dec-osf5.1b           |
             Status|NEW                         |RESOLVED
                 CC|                            |rth at gcc dot gnu.org
               Host|alpha-dec-osf5.1b           |
         Resolution|---                         |WORKSFORME
              Build|alpha-dec-osf5.1b           |

--- Comment #8 from Richard Henderson <rth at gcc dot gnu.org> ---
Removing the osf5.1b target because that's no longer supported.

There's an error in rs6000.c when attempting to cross-compile
to rs6000-ibm-aix5.3.0; I didn't spend too much time looking at it.

But I reasoned that if this is really any target using emutls,
I ought to be able to replicate it with --disable-tls on any host.

I don't see the ICE, so I'm willing to believe that the problem
has been fixed somewhere in the last 3 years.


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

end of thread, other threads:[~2015-02-13  0:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-07 17:42 [Bug tree-optimization/49316] New: ICE in in function_and_variable_visibility, at ipa.c:926 with g++.dg/tls/diag-1.C ro at gcc dot gnu.org
2011-07-19 14:12 ` [Bug tree-optimization/49316] " ro at gcc dot gnu.org
2011-10-25 20:04 ` greed at pobox dot com
2011-10-26  9:23 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-10-26 15:37 ` greed at pobox dot com
2011-10-26 15:40 ` greed at pobox dot com
2011-10-26 15:52 ` ro at CeBiTec dot Uni-Bielefeld.DE
2011-10-28 17:18 ` greed at pobox dot com
2015-02-13  0:22 ` rth 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).