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.
From-SVN: r216361