[Bug middle-end/61848] [5 Regression] a previous declaration causes the section attribute to be lost
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Oct 17 05:10:00 GMT 2014
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61848
--- Comment #21 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Author: trippels
Date: Fri Oct 17 05:10:07 2014
New Revision: 216361
URL: https://gcc.gnu.org/viewcvs?rev=216361&root=gcc&view=rev
Log:
Fix pr61848, linux kernel miscompile
This patch cures the linux kernel boot failure when compiled using
trunk gcc.
At its heart, the problem is caused by merge_decls merging from the
old decl to the new decl, then copying back to the old decl and
discarding the new. When Jan moved some fields to the symtab,
"copying back to the old decl" was lost for those fields. Really,
it would be best if merge_decls was rewritten to merge everything to
the kept decl, but here I'm just doing that for fields accessed via
decl_with_vis.symtab_node.
2014-10-17 Alan Modra <amodra@gmail.com>
gcc/c/
PR middle-end/61848
* c-decl.c (merge_decls): Don't merge section name or tls model
to newdecl symtab node, instead merge to olddecl. Override
existing olddecl section name. Set tls_model for all thread-local
vars, not just OMP thread-private ones. Remove incorrect comment.
gcc/cp/
PR middle-end/61848
* decl.c (merge_decls): Don't merge section name, comdat group or
tls model to newdecl symtab node, instead merge to olddecl.
Override existing olddecl section name. Set tls_model for all
thread-local vars, not just OMP thread-private ones. Remove
incorrect comment.
2014-10-17 Markus Trippelsdorf <markus@trippelsdorf.de>
PR middle-end/61848
* g++.dg/torture/pr61848.C: New testcase.
* gcc.c-torture/compile/pr61848.c: New testcase.
Added:
trunk/gcc/testsuite/g++.dg/torture/pr61848.C
trunk/gcc/testsuite/gcc.c-torture/compile/pr61848.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c/c-decl.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/testsuite/ChangeLog
More information about the Gcc-bugs
mailing list