This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71528] [5/6/7 Regression] multiple extern reference declarations produce uninitialized access
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 14 Jun 2016 13:31:24 +0000
- Subject: [Bug c++/71528] [5/6/7 Regression] multiple extern reference declarations produce uninitialized access
- Auto-submitted: auto-generated
- References: <bug-71528-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71528
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-06-14
Ever confirmed|0 |1
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That said, I believe the bug is not there, but in the FE.
x is initially marked TREE_READONLY, then cp_finish_decl clears the
TREE_READONLY bit:
6782 {
6783 was_readonly = 1;
6784 TREE_READONLY (decl) = 0;
6785 }
because it has an initializer that is invoked at runtime, but then
duplicate_decls sets it again:
2117 /* Merge the type qualifiers. */
2118 if (TREE_READONLY (newdecl))
2119 TREE_READONLY (olddecl) = 1;