* [Bug c++/50255] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
@ 2011-08-31 21:07 ` pinskia at gcc dot gnu.org
2011-08-31 22:01 ` pinskia at gcc dot gnu.org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-08-31 21:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-08-31 21:03:36 UTC ---
>GCC 4.6.0 20110603 (Red Hat 4.6.0-10)).
Does it happen with non RedHat version of the compiler meaning non modified
version of GCC? Really you should have reported this first to redhat as they
have some modifications to their compiler that might have caused this issue.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
2011-08-31 21:07 ` [Bug c++/50255] " pinskia at gcc dot gnu.org
@ 2011-08-31 22:01 ` pinskia at gcc dot gnu.org
2011-09-01 8:31 ` caolanm at redhat dot com
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-08-31 22:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-08-31 21:06:43 UTC ---
This sounds like http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49538 but without
a testcase it is hard to say if it was really on the 4.6 branch or only with
RedHat's compiler.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
2011-08-31 21:07 ` [Bug c++/50255] " pinskia at gcc dot gnu.org
2011-08-31 22:01 ` pinskia at gcc dot gnu.org
@ 2011-09-01 8:31 ` caolanm at redhat dot com
2011-09-01 8:40 ` stephan.bergmann.secondary at googlemail dot com
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: caolanm at redhat dot com @ 2011-09-01 8:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
Caolan McNamara <caolanm at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |caolanm at redhat dot com,
| |jakub at redhat dot com
--- Comment #3 from Caolan McNamara <caolanm at redhat dot com> 2011-09-01 08:29:54 UTC ---
caolanm->jakub: this is the one I mentioned as FOSDEM 11.
caolanm->sberg: able to attach something standalone that can reproduce this,
i.e. .ii
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
` (2 preceding siblings ...)
2011-09-01 8:31 ` caolanm at redhat dot com
@ 2011-09-01 8:40 ` stephan.bergmann.secondary at googlemail dot com
2011-09-01 12:12 ` stephan.bergmann.secondary at googlemail dot com
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: stephan.bergmann.secondary at googlemail dot com @ 2011-09-01 8:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
--- Comment #4 from Stephan Bergmann <stephan.bergmann.secondary at googlemail dot com> 2011-09-01 08:39:59 UTC ---
caolanm: will work on it, yes (wanted to clarify first whether looking at
those group name mismatches is actually looking in the right direction)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
` (3 preceding siblings ...)
2011-09-01 8:40 ` stephan.bergmann.secondary at googlemail dot com
@ 2011-09-01 12:12 ` stephan.bergmann.secondary at googlemail dot com
2011-09-02 13:16 ` stephan.bergmann.secondary at googlemail dot com
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: stephan.bergmann.secondary at googlemail dot com @ 2011-09-01 12:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
--- Comment #5 from Stephan Bergmann <stephan.bergmann.secondary at googlemail dot com> 2011-09-01 12:10:54 UTC ---
By the way, the problem of the rodata section having a different GroupName than
the text section is also present when you compile vbasheetobjects.cxx with
plain (non-RedHat-modified) GCC 4.6.0 and GCC 4.6.1, respectively.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
` (4 preceding siblings ...)
2011-09-01 12:12 ` stephan.bergmann.secondary at googlemail dot com
@ 2011-09-02 13:16 ` stephan.bergmann.secondary at googlemail dot com
2011-09-07 12:15 ` stephan.bergmann.secondary at googlemail dot com
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: stephan.bergmann.secondary at googlemail dot com @ 2011-09-02 13:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
--- Comment #6 from Stephan Bergmann <stephan.bergmann.secondary at googlemail dot com> 2011-09-02 13:15:42 UTC ---
While I still don't have a stripped down test case, I at least know now what is
going wrong (on recent gcc-4_6-branch rev 178396, at least):
When compiling vbasheetobjects.cxx, the text section for the non-virtual thunk
(with section name ".text._ZN19..." and group name "_ZThn20_N19...") is first
obtained at
get_section()
hot_function_section()
function_section_1()
function_section_1()
assemble_start_function()
assemble_thunk()
cgraph_expand_function()
cgraph_expand_all_functions()
cgraph_optimize()
cgraph_finalize_compilation_unit()
cp_write_global_declarations()
compile_file()
do_compile()
toplev_main()
main()
There, get_section() is called with decl pointing to the thunk, as
assemble_thunk() sets global current_function_decl = thunk_fndecl;
Later on, the corresponding rodata section for the non-virtual thunk (with
section name ".rodata._ZN19..." and erroneous group name "_ZN19..." instead of
"_ZThn20_N19...") is first obtained at
get_section()
default_function_rodata_section()
final_scan_insn()
final()
rest_of_handle_final()
execute_one_pass()
execute_pass_list()
execute_pass_list()
execute_pass_list()
tree_rest_of_compilation()
cgraph_expand_function()
...
a few lines further down in the same invocation of cgraph_expand_function()
(and in final_scan_insn() we are at
switch_to_section(targetm.asm_out.function_rodata_section(current_function_decl));).
But this time, current_function_decl points to the function itself, not the
non-virtual thunk, as tree_rest_of_compilation() sets current_function_decl =
fndecl;
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
` (5 preceding siblings ...)
2011-09-02 13:16 ` stephan.bergmann.secondary at googlemail dot com
@ 2011-09-07 12:15 ` stephan.bergmann.secondary at googlemail dot com
2011-09-07 12:24 ` stephan.bergmann.secondary at googlemail dot com
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: stephan.bergmann.secondary at googlemail dot com @ 2011-09-07 12:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
--- Comment #7 from Stephan Bergmann <stephan.bergmann.secondary at googlemail dot com> 2011-09-07 12:12:04 UTC ---
Created attachment 25220
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25220
reduced test case
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
` (6 preceding siblings ...)
2011-09-07 12:15 ` stephan.bergmann.secondary at googlemail dot com
@ 2011-09-07 12:24 ` stephan.bergmann.secondary at googlemail dot com
2011-09-07 14:41 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: stephan.bergmann.secondary at googlemail dot com @ 2011-09-07 12:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
--- Comment #8 from Stephan Bergmann <stephan.bergmann.secondary at googlemail dot com> 2011-09-07 12:14:56 UTC ---
Created attachment 25221
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25221
script compiling test case and showing broken result
I finally have a stripped down test case now that shows that compiling the
given code leads to mismatched group names for the .text and .rodata sections
of the non-virtual thunk (the first three .sections in the output).
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
` (7 preceding siblings ...)
2011-09-07 12:24 ` stephan.bergmann.secondary at googlemail dot com
@ 2011-09-07 14:41 ` jakub at gcc dot gnu.org
2011-09-07 15:44 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-09-07 14:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-09-07
CC| |jakub at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-09-07 14:33:52 UTC ---
This changed on the trunk with Honza's Cgraph thunk reorg (which isn't really
backportable):
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173517
in r173516 we have
.section
.text._ZN1TI1WI1XEE1hEP1A,"axG",@progbits,_ZThn8_N1TI1WI1XEE1hEP1A,comdat
.section
.rodata._ZN1TI1WI1XEE1hEP1A,"aG",@progbits,_ZN1TI1WI1XEE1hEP1A,comdat
.section
.text._ZN1TI1WI1XEE1hEP1A,"axG",@progbits,_ZThn8_N1TI1WI1XEE1hEP1A,comdat
while in r173517
.section
.text._ZN1TI1WI1XEE1hEP1A,"axG",@progbits,_ZN1TI1WI1XEE1hEP1A,comdat
.section
.rodata._ZN1TI1WI1XEE1hEP1A,"aG",@progbits,_ZN1TI1WI1XEE1hEP1A,comdat
.section
.text._ZN1TI1WI1XEE1hEP1A,"axG",@progbits,_ZN1TI1WI1XEE1hEP1A,comdat
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
` (8 preceding siblings ...)
2011-09-07 14:41 ` jakub at gcc dot gnu.org
@ 2011-09-07 15:44 ` jakub at gcc dot gnu.org
2011-09-08 6:06 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-09-07 15:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-09-07 15:27:16 UTC ---
Created attachment 25223
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25223
gcc46-pr50255.patch
Untested fix. If we decide to emit the thunk in the same section as the
function, it'd better use the right comdat group as well.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
` (9 preceding siblings ...)
2011-09-07 15:44 ` jakub at gcc dot gnu.org
@ 2011-09-08 6:06 ` jakub at gcc dot gnu.org
2011-09-08 6:39 ` [Bug c++/50255] [4.5 Regression] " jakub at gcc dot gnu.org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-09-08 6:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-09-08 06:03:11 UTC ---
Author: jakub
Date: Thu Sep 8 06:03:01 2011
New Revision: 178675
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178675
Log:
PR c++/50255
* method.c (use_thunk): If emitting thunk into the same section
as function, use the same DECL_COMDAT_GROUP as well.
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/method.c
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] [4.5 Regression] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
` (10 preceding siblings ...)
2011-09-08 6:06 ` jakub at gcc dot gnu.org
@ 2011-09-08 6:39 ` jakub at gcc dot gnu.org
2012-06-20 13:07 ` rguenth at gcc dot gnu.org
2012-07-02 10:15 ` rguenth at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-09-08 6:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.5.4
Summary|Linker stumbles over |[4.5 Regression] Linker
|non-grouped text/rodata for |stumbles over non-grouped
|a non-virtual thunk |text/rodata for a
| |non-virtual thunk
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-09-08 06:06:40 UTC ---
Fixed for 4.6, 4.7 doesn't have this bug, 4.4 neither, so 4.5 is the only one
left unfixed right now.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] [4.5 Regression] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
` (11 preceding siblings ...)
2011-09-08 6:39 ` [Bug c++/50255] [4.5 Regression] " jakub at gcc dot gnu.org
@ 2012-06-20 13:07 ` rguenth at gcc dot gnu.org
2012-07-02 10:15 ` rguenth at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-20 13:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Priority|P3 |P2
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug c++/50255] [4.5 Regression] Linker stumbles over non-grouped text/rodata for a non-virtual thunk
2011-08-31 21:04 [Bug c++/50255] New: Linker stumbles over non-grouped text/rodata for a non-virtual thunk stephan.bergmann.secondary at googlemail dot com
` (12 preceding siblings ...)
2012-06-20 13:07 ` rguenth at gcc dot gnu.org
@ 2012-07-02 10:15 ` rguenth at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 10:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50255
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|4.5.4 |4.6.2
--- Comment #13 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 10:14:35 UTC ---
Fixed in 4.6.2.
^ permalink raw reply [flat|nested] 15+ messages in thread