This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31072] [4.2/4.3 Rgression] Wrong code for volatile var with initalization and optimization
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Mar 2007 19:15:10 -0000
- Subject: [Bug c/31072] [4.2/4.3 Rgression] Wrong code for volatile var with initalization and optimization
- References: <bug-31072-9614@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from pinskia at gcc dot gnu dot org 2007-03-08 19:15 -------
Here is the patch which I am testing:
Index: c-decl.c
===================================================================
--- c-decl.c (revision 1532)
+++ c-decl.c (working copy)
@@ -1650,11 +1650,7 @@ merge_decls (tree newdecl, tree olddecl,
TREE_READONLY (olddecl) = 1;
if (TREE_THIS_VOLATILE (newdecl))
- {
- TREE_THIS_VOLATILE (olddecl) = 1;
- if (TREE_CODE (newdecl) == VAR_DECL)
- make_var_volatile (newdecl);
- }
+ TREE_THIS_VOLATILE (olddecl) = 1;
/* Merge deprecatedness. */
if (TREE_DEPRECATED (newdecl))
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31072