diff options
| author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-07-18 17:53:35 +0000 |
|---|---|---|
| committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-07-18 17:53:35 +0000 |
| commit | eec2bdfb328d15e3441cf215ad51c83c9e3ca0ef (patch) | |
| tree | 6154740f732e8db899e1935b6c2436ff0fdcab1b | |
| parent | 5fc46eb513613682066e2b4f5d3339ab178edb53 (diff) | |
| download | ppe42-gcc-eec2bdfb328d15e3441cf215ad51c83c9e3ca0ef.tar.gz ppe42-gcc-eec2bdfb328d15e3441cf215ad51c83c9e3ca0ef.zip | |
* c-decl.c (duplicate_decls): Do not call make_var_volatile() in
case of invalid volatile re-declaration.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35119 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/c-decl.c | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b183280c992..a8cd839fd91 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-07-18 Alexandre Oliva <aoliva@redhat.com> + + * c-decl.c (duplicate_decls): Do not call make_var_volatile() in + case of invalid volatile re-declaration. + 2000-07-18 Jakub Jelinek <jakub@redhat.com> * calls.c (store_arg): Return non-zero if sibcall_failure is diff --git a/gcc/c-decl.c b/gcc/c-decl.c index b759fd5e3ae..c2bbb95c5fe 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1843,7 +1843,14 @@ duplicate_decls (newdecl, olddecl, different_binding_level) if (TREE_THIS_VOLATILE (newdecl)) { TREE_THIS_VOLATILE (write_olddecl) = 1; - if (TREE_CODE (newdecl) == VAR_DECL) + if (TREE_CODE (newdecl) == VAR_DECL + /* If an automatic variable is re-declared in the same + function scope, but the old declaration was not + volatile, make_var_volatile() would crash because the + variable would have been assigned to a pseudo, not a + MEM. Since this duplicate declaration is invalid + anyway, we just skip the call. */ + && errmsg == 0) make_var_volatile (newdecl); } |

