[Bug c++/77316] [5 Regression] Unnecessary template copy constructor weak symbol emitted in wrong section

2017-10-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77316

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||jakub at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|5.5 |6.0

--- Comment #5 from Jakub Jelinek  ---
GCC 5 branch has been closed, should be fixed in GCC 6 and later.

[Bug c++/77316] [5 Regression] Unnecessary template copy constructor weak symbol emitted in wrong section

2016-12-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77316

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/77316] [5 Regression] Unnecessary template copy constructor weak symbol emitted in wrong section

2016-08-22 Thread rbd at debian dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77316

--- Comment #4 from Roland Dreier  ---
Discovered this is due to abi-compat, I think.  gcc 6 works because abi-compat
went from 2 (gcc 5.4) to 8, and the significant break is 6 -> 7:

$ g++ -Wabi=6 --std=c++11 -c b.cpp  
b.cpp: In instantiation of ‘vec::vec(A) [with A = alloc]’:
b.cpp:5:46:   required from ‘void vec::operator=(vec) [with A =
alloc; vec = vec]’
b.cpp:16:6:   required from here
b.cpp:4:3: warning: the mangled name of ‘vec::vec(A) [with A =
alloc]’ changed between -fabi-version=6
(_ZN3vecI5allocIDnEEC1ES2_) and -fabi-version=9 (_ZN3vecI5allocIDnEEC1ES1_)
[-Wabi]
   vec(A) {}
   ^
b.cpp:4:3: warning: the mangled name of ‘vec::vec(A) [with A =
alloc]’ changed between -fabi-version=6
(_ZN3vecI5allocIDnEEC2ES2_) and -fabi-version=9 (_ZN3vecI5allocIDnEEC2ES1_)
[-Wabi]
b.cpp:5:8: warning: the mangled name of ‘void vec::operator=(vec) [with A
= alloc; vec = vec]’ changed between
-fabi-version=6 (_ZN3vecI5allocIDnEEaSES3_) and -fabi-version=9
(_ZN3vecI5allocIDnEEaSES2_) [-Wabi]
   void operator=(vec) { vec a(get_allocator()); }
^

So gcc is generating a backward-compatible symbol that happens to collide with
a different symbol in the current ABI.

Not sure I see a way for this to be fixed, but it's a really unfortunate
booby-trap.  I guess I can work around it by just building with -Wabi=7 and/or
-fabi-compat-version=0.

[Bug c++/77316] [5 Regression] Unnecessary template copy constructor weak symbol emitted in wrong section

2016-08-22 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77316

Richard Biener  changed:

   What|Removed |Added

  Known to work||4.9.4
   Target Milestone|--- |5.5
Summary|Unnecessary template copy   |[5 Regression] Unnecessary
   |constructor weak symbol |template copy constructor
   |emitted in wrong section|weak symbol emitted in
   ||wrong section