[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 Jakub Jelinek jakub at gcc dot gnu.org changed: What|Removed |Added CC||fche at redhat dot com, ||jakub at gcc dot gnu.org --- Comment #12 from Jakub Jelinek jakub at gcc dot gnu.org --- In particular, the problem is that we used to have a hacked up version of svnmailer, which created the special emails for bugzilla, now the server has a new upstream version of svnmailer and these hacks weren't ported to it.
[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 --- Comment #9 from Paolo Carlini paolo.carlini at oracle dot com --- It's broken since the Bugzilla update, unfortunately.
[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 --- Comment #10 from Andrew Pinski pinskia at gcc dot gnu.org --- (In reply to Paolo Carlini from comment #9) It's broken since the Bugzilla update, unfortunately. No broken since updating the server to a new machine. Updating Bugzilla was not the issue but updating the subversion on the server was.
[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 --- Comment #11 from Paolo Carlini paolo.carlini at oracle dot com --- Right sorry, the problem is the new subversion not sending commit messages at all to Bugzilla.
[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 --- Comment #6 from Jan Hubicka hubicka at ucw dot cz --- Good to be assigned. I posted the patch Jason, can you please look at http://gcc.gnu.org/ml/gcc-patches/2013-06/msg00433.html Honza
[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 --- Comment #7 from Jason Merrill jason at gcc dot gnu.org --- (In reply to Jan Hubicka from comment #6) Jason, can you please look at http://gcc.gnu.org/ml/gcc-patches/2013-06/msg00433.html I approved it the same day you posted it. :)
[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 Hans-Peter Nilsson hp at gcc dot gnu.org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #8 from Hans-Peter Nilsson hp at gcc dot gnu.org --- Intended fix committed as noticed by my autotester, so I'm closing this. Looks like the svn commit - bugzilla interface is broken or severely delayed; the log seems ok and should match, AFAICT: Log: PR c++/57551 * g++.dg/ext/visibility/anon6.C: Update testcase. * cp/pt.c (mark_decl_instantiated): Do not export explicit instantiations of anonymous namespace templates.
[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 Jason Merrill jason at gcc dot gnu.org changed: What|Removed |Added Assignee|jason at gcc dot gnu.org |unassigned at gcc dot gnu.org --- Comment #5 from Jason Merrill jason at gcc dot gnu.org --- Reassigning since Honza has been working on this.
[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 Jan Hubicka hubicka at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed||2013-06-07 CC||hubicka at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |hubicka at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Jan Hubicka hubicka at gcc dot gnu.org --- mine.
[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 Jan Hubicka hubicka at gcc dot gnu.org changed: What|Removed |Added CC||jason at redhat dot com --- Comment #2 from Jan Hubicka hubicka at gcc dot gnu.org --- You are right, I added attribute used to the variable and forgot about it. The testcase is bogus by expecting unused local static to not be optmized away. Looking closer, I am however confused. While the attribute fixes the testcase, i think something wrong is still going on hre. We get the following symbol out of FE: _ZN12_GLOBAL__N_11BIiE1cE/1 (const int {anonymous}::Bint::c) @0x775141a0 Type: variable definition analyzed Visibility: force_output comdat Aux: @0x1 References: Referring: Availability: not-ready Varpool flags: initialized read-only const-value-known i.e. it is COMDAT but not public. It is the force_output flag that keeps variable alive and that is there because of keying. The variable is output as static object: jh@gcc10:~/trunk/build3/gcc$ more anon6.s .file anon6.C .section.rodata .align 4 .type _ZN12_GLOBAL__N_11BIiE1cE, @object .size _ZN12_GLOBAL__N_11BIiE1cE, 4 _ZN12_GLOBAL__N_11BIiE1cE: .zero 4 .ident GCC: (GNU) 4.9.0 20130602 (experimental) .section.note.GNU-stack,,@progbits i.e. no comdat visibility. This flag stays through the compilation and seems to be ignored by output routines. And now adding the attribute used: Index: /home/jh/trunk/gcc/testsuite/g++.dg/ext/visibility/anon6.C === --- /home/jh/trunk/gcc/testsuite/g++.dg/ext/visibility/anon6.C (revision 199698) +++ /home/jh/trunk/gcc/testsuite/g++.dg/ext/visibility/anon6.C (working copy) @@ -18,7 +18,7 @@ namespace template typename T class B { -static const T c = 0; +__attribute__ ((__used__)) static const T c = 0; }; template typename T const T BT::c; changes object to: _ZN12_GLOBAL__N_11BIiE1cE/1 (const int {anonymous}::Bint::c) @0x775141a0 Type: variable definition analyzed Visibility: force_output forced_by_abi public weak comdat comdat_group:_ZN12_GLOBAL__N_11BIiE1cE one_only Aux: @0x77402850 References: Referring: Availability: not-ready Varpool flags: initialized read-only const-value-known which changes assembly to: jh@gcc10:~/trunk/build/gcc$ ./xgcc -B ./ -O2 /home/jh/trunk/gcc/testsuite/g++.dg/ext/visibility/anon6.C -S -std=c++98 -pedantic-errors -Wno-long-long -S -fdump-ipa-all-details -fdump-ipa-cgraph jh@gcc10:~/trunk/build/gcc$ more anon6.s .file anon6.C .weak _ZN12_GLOBAL__N_11BIiE1cE .section .rodata._ZN12_GLOBAL__N_11BIiE1cE,aG,@progbits,_ZN12_GLOBAL__N_11BIiE1cE,comdat .align 4 .type _ZN12_GLOBAL__N_11BIiE1cE, @gnu_unique_object .size _ZN12_GLOBAL__N_11BIiE1cE, 4 _ZN12_GLOBAL__N_11BIiE1cE: .zero 4 .ident GCC: (GNU) 4.9.0 20130605 (experimental) .section.note.GNU-stack,,@progbits Here we now disagree with GCC 4.5 that still outputs this as static. Jason, why C++ FE behaves this way now? clang also optimizes out the variable in testcase and adding attribute used makes the var to be static. I think the testcase should be fixed by adding the used flag and by checking that weaks/comdats are not involved in the assembly and C++ FE should be fixed. or do I miss something? Honza
[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 Jason Merrill jason at gcc dot gnu.org changed: What|Removed |Added CC||jason at gcc dot gnu.org Assignee|hubicka at gcc dot gnu.org |jason at gcc dot gnu.org Target Milestone|--- |4.9.0 --- Comment #3 from Jason Merrill jason at gcc dot gnu.org --- Sounds right to me.
[Bug regression/57551] [4.9 Regression]: g++.dg/ext/visibility/anon6.C scan-assembler 1BIiE1cE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57551 --- Comment #4 from Jan Hubicka hubicka at gcc dot gnu.org --- OK, C++ FE properly brings the decl local as part of constrain_visibility, however later in pt.c it is made public again in mark_decl_instantiated as explicit instantiation. My wild try is the following: Index: pt.c === --- pt.c(revision 199698) +++ pt.c(working copy) @@ -17402,6 +17402,13 @@ mark_decl_instantiated (tree result, int if (TREE_ASM_WRITTEN (result)) return; + /* For anonymous namespace we don't need to do anything. */ + if (decl_anon_ns_mem_p (result)) +{ + gcc_assert (!TREE_PUBLIC (result)); + return; +} + if (TREE_CODE (result) != FUNCTION_DECL) /* The TREE_PUBLIC flag for function declarations will have been set correctly by tsubst. */