aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2000-07-18 17:53:35 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2000-07-18 17:53:35 +0000
commit79c282037d19cfd0c9cb1de06dc019a66c8e0d8b (patch)
tree6154740f732e8db899e1935b6c2436ff0fdcab1b /gcc/c-decl.c
parenta306451c69c32c01b8c498d321502a5a595fdd41 (diff)
downloadgcc-79c282037d19cfd0c9cb1de06dc019a66c8e0d8b.zip
gcc-79c282037d19cfd0c9cb1de06dc019a66c8e0d8b.tar.gz
gcc-79c282037d19cfd0c9cb1de06dc019a66c8e0d8b.tar.bz2
c-decl.c (duplicate_decls): Do not call make_var_volatile() in case of invalid volatile re-declaration.
* c-decl.c (duplicate_decls): Do not call make_var_volatile() in case of invalid volatile re-declaration. From-SVN: r35119
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index b759fd5..c2bbb95 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);
}