diff options
author | Andrew Pinski <andrew_pinski@playstation.sony.com> | 2007-03-09 00:32:34 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2007-03-08 16:32:34 -0800 |
commit | ee9f69b425fabd8af248d75fe7ee62ca17112253 (patch) | |
tree | 00b828664fda1c04e56f45ffb7f17ee5c3ffab4e /gcc | |
parent | 99681c8b0fdde287c11d0ef22cf6341fc661d323 (diff) | |
download | gcc-ee9f69b425fabd8af248d75fe7ee62ca17112253.zip gcc-ee9f69b425fabd8af248d75fe7ee62ca17112253.tar.gz gcc-ee9f69b425fabd8af248d75fe7ee62ca17112253.tar.bz2 |
re PR c/31072 ([4.2 Rgression] Wrong code for volatile var with initalization and optimization)
2007-03-08 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C/31072
* c-decl.c (merge_decls): Don't call make_var_volatile.
* varasm.c (make_var_volatile): Remove.
* output.h (make_var_volatile): Remove.
2007-03-08 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C/31072
* gcc.c-torture/execute/pr31072.c: New test.
From-SVN: r122736
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/c-decl.c | 6 | ||||
-rw-r--r-- | gcc/output.h | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/pr31072.c | 10 | ||||
-rw-r--r-- | gcc/varasm.c | 11 |
6 files changed, 23 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0cfed4b..91cb190 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-03-08 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR C/31072 + * c-decl.c (merge_decls): Don't call make_var_volatile. + * varasm.c (make_var_volatile): Remove. + * output.h (make_var_volatile): Remove. + 2007-03-08 Zdenek Dvorak <dvorakz@suse.cz> PR tree-optimization/31085 diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 0d9fce5..fd5b065 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1690,11 +1690,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) 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)) diff --git a/gcc/output.h b/gcc/output.h index 3c9bcc4..a5c29f0d 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -170,10 +170,6 @@ extern void emutls_finish (void); Prefixes such as % are optional. */ extern int decode_reg_name (const char *); -/* Make the rtl for variable VAR be volatile. - Use this only for static variables. */ -extern void make_var_volatile (tree); - extern void assemble_alias (tree, tree); extern void default_assemble_visibility (tree, int); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3023659..ba0392e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-03-08 Andrew Pinski <andrew_pinski@playstation.sony.com> + + PR C/31072 + * gcc.c-torture/execute/pr31072.c: New test. + 2007-03-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * gcc.dg/builtins-55.c: Test *lceil* and *lfloor*. diff --git a/gcc/testsuite/gcc.c-torture/execute/pr31072.c b/gcc/testsuite/gcc.c-torture/execute/pr31072.c new file mode 100644 index 0000000..beb4b55 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr31072.c @@ -0,0 +1,10 @@ +extern volatile int ReadyFlag_NotProperlyInitialized; + +volatile int ReadyFlag_NotProperlyInitialized=1; + +int main(void) +{ + if (ReadyFlag_NotProperlyInitialized != 1) + __builtin_abort (); + return 0; +} diff --git a/gcc/varasm.c b/gcc/varasm.c index c92a5a0..7e482b3 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1403,17 +1403,6 @@ make_decl_rtl (tree decl) if (flag_mudflap && TREE_CODE (decl) == VAR_DECL) mudflap_enqueue_decl (decl); } - -/* Make the rtl for variable VAR be volatile. - Use this only for static variables. */ - -void -make_var_volatile (tree var) -{ - gcc_assert (MEM_P (DECL_RTL (var))); - - MEM_VOLATILE_P (DECL_RTL (var)) = 1; -} /* Output a string of literal assembler code for an `asm' keyword used between functions. */ |