* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
@ 2012-07-03 13:18 ` hubicka at gcc dot gnu.org
2012-11-06 13:53 ` rafael.espindola at gmail dot com
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-07-03 13:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2012-07-03
CC| |hubicka at gcc dot gnu.org
AssignedTo|unassigned at gcc dot |hubicka at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
2012-07-03 13:18 ` [Bug lto/53808] " hubicka at gcc dot gnu.org
@ 2012-11-06 13:53 ` rafael.espindola at gmail dot com
2013-03-23 0:36 ` jason at gcc dot gnu.org
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rafael.espindola at gmail dot com @ 2012-11-06 13:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #1 from Rafael Avila de Espindola <rafael.espindola at gmail dot com> 2012-11-06 13:53:00 UTC ---
I can see two options for fixing this
1) producing a copy of the destructor when we devirtualize and not
devirtualizing if we cannot emit one.
2) making the destructor that is emitted with the vtable strong.
On the clang side John McCall likes the first option better
(http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-June/022606.html). Jason, what
do you think?
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
2012-07-03 13:18 ` [Bug lto/53808] " hubicka at gcc dot gnu.org
2012-11-06 13:53 ` rafael.espindola at gmail dot com
@ 2013-03-23 0:36 ` jason at gcc dot gnu.org
2013-03-23 21:40 ` hubicka at ucw dot cz
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2013-03-23 0:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2013-03-23 00:36:48 UTC ---
Created attachment 29709
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29709
partial (front end) patch
This patch causes the destructor to be created and marked as COMDAT, but for
some reason cgraph still isn't emitting it.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (2 preceding siblings ...)
2013-03-23 0:36 ` jason at gcc dot gnu.org
@ 2013-03-23 21:40 ` hubicka at ucw dot cz
2013-09-04 12:26 ` rafael.espindola at gmail dot com
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: hubicka at ucw dot cz @ 2013-03-23 21:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #3 from Jan Hubicka <hubicka at ucw dot cz> 2013-03-23 21:40:19 UTC ---
> This patch causes the destructor to be created and marked as COMDAT, but for
> some reason cgraph still isn't emitting it.
Thank you!. I will work out why it is not emitted.
Honza
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (3 preceding siblings ...)
2013-03-23 21:40 ` hubicka at ucw dot cz
@ 2013-09-04 12:26 ` rafael.espindola at gmail dot com
2014-02-25 17:47 ` jason at gcc dot gnu.org
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rafael.espindola at gmail dot com @ 2013-09-04 12:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #4 from Rafael Avila de Espindola <rafael.espindola at gmail dot com> ---
The equivalent clang bug (llvm.org/pr13124) just got fixed by avoiding the
devirtualization in this case.
Not sure how similar the issues are internally, but I summarized what I found
in clang in:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130902/087810.html
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (4 preceding siblings ...)
2013-09-04 12:26 ` rafael.espindola at gmail dot com
@ 2014-02-25 17:47 ` jason at gcc dot gnu.org
2014-02-25 17:57 ` jason at gcc dot gnu.org
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-25 17:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
I just tried to reproduce the bug before checking my patch in for 4.9, and
couldn't; my patch seems to make no difference to the cgraph output for
def.cpp. So I guess it isn't needed anymore. Does that seem right to you?
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (5 preceding siblings ...)
2014-02-25 17:47 ` jason at gcc dot gnu.org
@ 2014-02-25 17:57 ` jason at gcc dot gnu.org
2014-02-25 18:55 ` jason at gcc dot gnu.org
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-25 17:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #6)
> I just tried to reproduce the bug before checking my patch in for 4.9, and
> couldn't; my patch seems to make no difference to the cgraph output for
> def.cpp.
...but it does make a difference to undef.cpp. Never mind.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (6 preceding siblings ...)
2014-02-25 17:57 ` jason at gcc dot gnu.org
@ 2014-02-25 18:55 ` jason at gcc dot gnu.org
2014-02-25 19:00 ` jason at gcc dot gnu.org
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-25 18:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Feb 25 18:54:48 2014
New Revision: 208153
URL: http://gcc.gnu.org/viewcvs?rev=208153&root=gcc&view=rev
Log:
PR lto/53808
* class.c (clone_function_decl): Call note_vague_linkage_fn for
defaulted virtual dtor.
Added:
trunk/gcc/testsuite/g++.dg/opt/devirt4.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/class.c
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (7 preceding siblings ...)
2014-02-25 18:55 ` jason at gcc dot gnu.org
@ 2014-02-25 19:00 ` jason at gcc dot gnu.org
2014-02-26 21:33 ` jason at gcc dot gnu.org
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-25 19:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |4.9.0
--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> ---
Devirtualization + inlining of ~bar fixed for 4.9.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (8 preceding siblings ...)
2014-02-25 19:00 ` jason at gcc dot gnu.org
@ 2014-02-26 21:33 ` jason at gcc dot gnu.org
2014-06-30 20:21 ` jason at gcc dot gnu.org
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-26 21:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Feb 26 21:32:41 2014
New Revision: 208184
URL: http://gcc.gnu.org/viewcvs?rev=208184&root=gcc&view=rev
Log:
PR c++/60347
PR lto/53808
* class.c (clone_function_decl): Don't note_vague_linkage_fn.
* init.c (build_vtbl_address): Do it here.
Added:
trunk/gcc/testsuite/g++.dg/template/dtor9.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/class.c
trunk/gcc/cp/init.c
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (9 preceding siblings ...)
2014-02-26 21:33 ` jason at gcc dot gnu.org
@ 2014-06-30 20:21 ` jason at gcc dot gnu.org
2014-07-22 14:03 ` rafael.espindola at gmail dot com
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-06-30 20:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #11 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Mon Jun 30 20:20:55 2014
New Revision: 212174
URL: https://gcc.gnu.org/viewcvs?rev=212174&root=gcc&view=rev
Log:
PR c++/61659
PR lto/53808
gcc/cp
* decl2.c (maybe_emit_vtables): Mark all vtable entries if
devirtualizing.
* init.c (build_vtbl_address): Don't mark destructor.
* class.c (finish_struct_1): Add all classes to keyed_classes
if devirtualizing.
libstdc++-v3/
* libsupc++/cxxabi.h (class __pbase_type_info): __pointer_catch
is pure, not inline.
Added:
trunk/gcc/testsuite/g++.dg/opt/devirt5.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/class.c
trunk/gcc/cp/decl2.c
trunk/gcc/cp/init.c
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/libsupc++/cxxabi.h
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (10 preceding siblings ...)
2014-06-30 20:21 ` jason at gcc dot gnu.org
@ 2014-07-22 14:03 ` rafael.espindola at gmail dot com
2014-07-30 17:28 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: rafael.espindola at gmail dot com @ 2014-07-22 14:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #12 from Rafael Avila de Espindola <rafael.espindola at gmail dot com> ---
Note that this bug is present once more when -fno-use-all-virtuals is used.
With the original testcase gcc again produces an undefined reference to
_ZN3barD0Ev.
Is -fno-use-all-virtuals intended to be an abi breaking option? If so it would
be nice to document that.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (11 preceding siblings ...)
2014-07-22 14:03 ` rafael.espindola at gmail dot com
@ 2014-07-30 17:28 ` jason at gcc dot gnu.org
2014-07-30 21:30 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-07-30 17:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #13 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Jul 30 17:27:14 2014
New Revision: 213307
URL: https://gcc.gnu.org/viewcvs?rev=213307&root=gcc&view=rev
Log:
PR lto/53808
PR c++/61659
* pt.c (push_template_decl_real): Set DECL_COMDAT on templates.
(check_explicit_specialization): Clear it on specializations.
* decl.c (duplicate_decls, start_decl): Likewise.
(grokmethod, grokfndecl): Set DECL_COMDAT on inlines.
* method.c (implicitly_declare_fn): Set DECL_COMDAT. Determine
linkage after setting the appropriate flags.
* tree.c (decl_linkage): Don't check DECL_COMDAT.
* decl2.c (mark_needed): Mark clones.
(import_export_decl): Not here.
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/cp/decl2.c
trunk/gcc/cp/method.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/tree.c
trunk/gcc/testsuite/g++.dg/opt/devirt4.C
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (12 preceding siblings ...)
2014-07-30 17:28 ` jason at gcc dot gnu.org
@ 2014-07-30 21:30 ` jason at gcc dot gnu.org
2014-08-19 17:30 ` jason at gcc dot gnu.org
2014-09-10 14:28 ` jason at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-07-30 21:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #14 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Jul 30 21:29:25 2014
New Revision: 213311
URL: https://gcc.gnu.org/viewcvs?rev=213311&root=gcc&view=rev
Log:
PR lto/53808
PR c++/61659
* pt.c (push_template_decl_real): Don't set DECL_COMDAT on friends.
Added:
trunk/gcc/testsuite/g++.dg/template/friend56.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (13 preceding siblings ...)
2014-07-30 21:30 ` jason at gcc dot gnu.org
@ 2014-08-19 17:30 ` jason at gcc dot gnu.org
2014-09-10 14:28 ` jason at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-08-19 17:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #15 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Aug 19 17:29:41 2014
New Revision: 214177
URL: https://gcc.gnu.org/viewcvs?rev=214177&root=gcc&view=rev
Log:
PR lto/53808
PR c++/61659
* decl.c (maybe_commonize_var): Don't use DECL_COMDAT to trigger
comdat_linkage.
Added:
trunk/gcc/testsuite/g++.dg/abi/spec1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug lto/53808] Undefined symbol when building a library with lto
2012-06-29 18:20 [Bug lto/53808] New: Undefined symbol when building a library with lto rafael.espindola at gmail dot com
` (14 preceding siblings ...)
2014-08-19 17:30 ` jason at gcc dot gnu.org
@ 2014-09-10 14:28 ` jason at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2014-09-10 14:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53808
--- Comment #16 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Sep 10 14:27:40 2014
New Revision: 215131
URL: https://gcc.gnu.org/viewcvs?rev=215131&root=gcc&view=rev
Log:
PR lto/53808
PR c++/61659
* decl2.c (note_comdat_fn): New.
(set_comdat): New.
(cp_write_global_declarations): Call set_comdat.
* method.c (implicitly_declare_fn): Call note_comdat_fn.
* pt.c (tsubst_decl) [FUNCTION_DECL]: Likewise.
* decl2.c (mark_needed): Mark clones.
(import_export_decl): Not here.
Added:
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/abi/no-weak1.C
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/abi/spec1.C
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/opt/devirt5.C
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/template/friend56.C
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/template/spec38.C
Modified:
branches/gcc-4_9-branch/gcc/cp/ChangeLog
branches/gcc-4_9-branch/gcc/cp/cp-tree.h
branches/gcc-4_9-branch/gcc/cp/decl2.c
branches/gcc-4_9-branch/gcc/cp/method.c
branches/gcc-4_9-branch/gcc/cp/pt.c
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/opt/devirt4.C
^ permalink raw reply [flat|nested] 17+ messages in thread