[Bug c++/35368] [4.1/4.2/4.3/4.4 Regression] With #pragma visibility, `vtable for __cxxabiv1::__class_type_info' is emitted as a hidden-visibility relocation

2008-02-27 Thread jakub at gcc dot gnu dot org


--- Comment #11 from jakub at gcc dot gnu dot org  2008-02-27 09:09 ---
Subject: Bug 35368

Author: jakub
Date: Wed Feb 27 09:09:05 2008
New Revision: 132704

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=132704
Log:
PR c++/35368
* rtti.c: Include c-pragma.h.
(push_abi_namespace, pop_abi_namespace): New functions.
(build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index,
create_tinfo_types, emit_support_tinfos): Use them.
* Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H).

* g++.dg/ext/visibility/typeinfo2.C: New test.
* g++.dg/ext/visibility/typeinfo3.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/ext/visibility/typeinfo2.C
trunk/gcc/testsuite/g++.dg/ext/visibility/typeinfo3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/Make-lang.in
trunk/gcc/cp/rtti.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug c++/35368] [4.1/4.2/4.3/4.4 Regression] With #pragma visibility, `vtable for __cxxabiv1::__class_type_info' is emitted as a hidden-visibility relocation

2008-02-27 Thread jakub at gcc dot gnu dot org


--- Comment #12 from jakub at gcc dot gnu dot org  2008-02-27 09:27 ---
Subject: Bug 35368

Author: jakub
Date: Wed Feb 27 09:26:24 2008
New Revision: 132705

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=132705
Log:
PR c++/35368
* rtti.c: Include c-pragma.h.
(push_abi_namespace, pop_abi_namespace): New functions.
(build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index,
create_tinfo_types, emit_support_tinfos): Use them.
* Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H).

* g++.dg/ext/visibility/typeinfo2.C: New test.
* g++.dg/ext/visibility/typeinfo3.C: New test.

Added:
branches/gcc-4_3-branch/gcc/testsuite/g++.dg/ext/visibility/typeinfo2.C
branches/gcc-4_3-branch/gcc/testsuite/g++.dg/ext/visibility/typeinfo3.C
Modified:
branches/gcc-4_3-branch/gcc/cp/ChangeLog
branches/gcc-4_3-branch/gcc/cp/Make-lang.in
branches/gcc-4_3-branch/gcc/cp/rtti.c
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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



[Bug c++/35368] [4.1/4.2/4.3/4.4 Regression] With #pragma visibility, `vtable for __cxxabiv1::__class_type_info' is emitted as a hidden-visibility relocation

2008-02-26 Thread jakub at gcc dot gnu dot org


--- Comment #5 from jakub at gcc dot gnu dot org  2008-02-26 16:30 ---
Testing a patch.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2008-02-25 15:54:38 |2008-02-26 16:30:23
   date||


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



[Bug c++/35368] [4.1/4.2/4.3/4.4 Regression] With #pragma visibility, `vtable for __cxxabiv1::__class_type_info' is emitted as a hidden-visibility relocation

2008-02-26 Thread mmitchel at gcc dot gnu dot org


--- Comment #6 from mmitchel at gcc dot gnu dot org  2008-02-26 17:06 
---
We need to be careful about this.  We have a lot of ways to specify visibility:
dllimport/dllexport attributes, notshared attribute, visibility attributes on
classes.

I actually think the compiler is behaving as intended here.  To me:

  #pragma GCC push visibility(hidden)

is equivalent to applying:

  __attribute__((visibility(hidden))) 

to all declarations in the scope of the #pragma.

And, a class with hidden visibility does have a hidden virtual table.

Why do we think this is a bug?


-- 


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



[Bug c++/35368] [4.1/4.2/4.3/4.4 Regression] With #pragma visibility, `vtable for __cxxabiv1::__class_type_info' is emitted as a hidden-visibility relocation

2008-02-26 Thread jakub at gcc dot gnu dot org


--- Comment #7 from jakub at gcc dot gnu dot org  2008-02-26 17:19 ---
Created an attachment (id=15233)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15233action=view)
gcc43-pr35368.patch

Patch I'm testing.
The reasons it should IMNSHO have default visibility is:
1) these are compiler generated references and libsupc++.a/libstdc++.a provided
   symbols.  For e.g. builtins we use default visibility as well, rather than
   the current default one
2) the same reason why do the typeinfo etc. headers have those
   #pragma GCC visibility push(default)/#pragma GCC visibility pop around them


-- 


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



[Bug c++/35368] [4.1/4.2/4.3/4.4 Regression] With #pragma visibility, `vtable for __cxxabiv1::__class_type_info' is emitted as a hidden-visibility relocation

2008-02-26 Thread benjamin at smedbergs dot us


--- Comment #8 from benjamin at smedbergs dot us  2008-02-26 17:25 ---
Yes, to make it clear: the class typeinfo object may have hidden visibility...
it's the __cxxabiv1::__class_type_info class that should have default
visibility always.


-- 


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



[Bug c++/35368] [4.1/4.2/4.3/4.4 Regression] With #pragma visibility, `vtable for __cxxabiv1::__class_type_info' is emitted as a hidden-visibility relocation

2008-02-26 Thread jakub at gcc dot gnu dot org


--- Comment #9 from jakub at gcc dot gnu dot org  2008-02-26 17:39 ---
BTW, not sure why 4.1.x/4.2.x is listed as broken.  Only 4.3+ has H.J's:
http://gcc.gnu.org/viewcvs?root=gccview=revrev=119764
Without that change, although __cxxabiv1::* symbols are incorrectly marked
as hidden, GCC doesn't emit .hidden directives for the external symbols and all
these symbols of course are external, as they are defined in
libsupc++.a/libstdc++.{so,a}, and as they are referenced just in the RTTI
pointers, not in code directly, it makes zero difference to the generated code
whether they are hidden or not.

BTW, I've noticed that for _ZTI*/_ZTV* symbols defined in the assembly .hidden
directives are emitted twice, once at the definition spot and once at the end
of the file.  Guess assemble_external_real should skip decls that lost
DECL_EXTERNAL flag (became defined in the current TU).


-- 


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



[Bug c++/35368] [4.1/4.2/4.3/4.4 Regression] With #pragma visibility, `vtable for __cxxabiv1::__class_type_info' is emitted as a hidden-visibility relocation

2008-02-26 Thread mark at codesourcery dot com


--- Comment #10 from mark at codesourcery dot com  2008-02-26 17:57 ---
Subject: Re:  [4.1/4.2/4.3/4.4 Regression] With #pragma visibility,
 `vtable for __cxxabiv1::__class_type_info' is emitted as a hidden-visibility
 relocation

benjamin at smedbergs dot us wrote:
 --- Comment #8 from benjamin at smedbergs dot us  2008-02-26 17:25 ---
 Yes, to make it clear: the class typeinfo object may have hidden visibility...
 it's the __cxxabiv1::__class_type_info class that should have default
 visibility always.

Oh, I see!  Yes, __cxxabiv1::* should definitely have default visibility.

Thanks,


-- 


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



[Bug c++/35368] [4.1/4.2/4.3/4.4 Regression] With #pragma visibility, `vtable for __cxxabiv1::__class_type_info' is emitted as a hidden-visibility relocation

2008-02-25 Thread rguenth at gcc dot gnu dot org


--- Comment #3 from rguenth at gcc dot gnu dot org  2008-02-25 15:54 ---
Doens't work for me with 4.1.3 20080114, 4.2.3 or 4.3.0 20080219.  Works with
4.0.4 20060904.

The bogus reference is here:

.LEFDE5:
.hidden DW.ref.__gxx_personality_v0
.weak   DW.ref.__gxx_personality_v0
.section   
.data.DW.ref.__gxx_personality_v0,awG,@progbits,DW.ref.__gxx_personality_v0,comdat
.align 4
.type   DW.ref.__gxx_personality_v0, @object
.size   DW.ref.__gxx_personality_v0, 4
DW.ref.__gxx_personality_v0:
.long   __gxx_personality_v0
.hidden _ZTVN10__cxxabiv117__class_type_infoE
.hidden _ZTI1A
.hidden _ZTV1A


Maybe related to PR19159, but that is for systems w/o weak support.  This
is a regression on the 4.1/4.2 branches.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||mmitchel at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Keywords||wrong-code
  Known to fail|4.3.0   |4.1.3 4.2.3 4.3.0
  Known to work|4.2.1   |4.0.4 4.2.1
   Priority|P3  |P1
   Last reconfirmed|-00-00 00:00:00 |2008-02-25 15:54:38
   date||
Summary|With #pragma visibility,|[4.1/4.2/4.3/4.4 Regression]
   |`vtable for |With #pragma visibility,
   |__cxxabiv1::__class_type_inf|`vtable for
   |o' is emitted as a hidden-  |__cxxabiv1::__class_type_inf
   |visibility relocation   |o' is emitted as a hidden-
   ||visibility relocation
   Target Milestone|--- |4.1.3


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



[Bug c++/35368] [4.1/4.2/4.3/4.4 Regression] With #pragma visibility, `vtable for __cxxabiv1::__class_type_info' is emitted as a hidden-visibility relocation

2008-02-25 Thread matz at gcc dot gnu dot org


--- Comment #4 from matz at gcc dot gnu dot org  2008-02-25 16:18 ---
For me it works with gcc42-4.2.1_20070724-17.1 (i686).  With 4.3 it breaks.


-- 


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