Commit 8a7d6cb3 by Eric Botcazou Committed by Eric Botcazou

re PR c/9928 (ICE on duplicate enum declaration)

	PR c/9928
	* c-decl.c (duplicate_decls): Discard the initializer of the new decl
	only if it is a VAR_DECL.

From-SVN: r64235
parent db1077d3
2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr> 2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr>
PR c/9928
* c-decl.c (duplicate_decls): Discard the initializer of the new decl
only if it is a VAR_DECL.
2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr>
PR optimization/9888 PR optimization/9888
* config/i386/i386.md (jcc_1): Fix range. * config/i386/i386.md (jcc_1): Fix range.
(jcc_2): Likewise. (jcc_2): Likewise.
......
...@@ -1146,7 +1146,8 @@ duplicate_decls (newdecl, olddecl, different_binding_level) ...@@ -1146,7 +1146,8 @@ duplicate_decls (newdecl, olddecl, different_binding_level)
to variables that were declared between olddecl and newdecl. This to variables that were declared between olddecl and newdecl. This
will make the initializer invalid for olddecl in case it gets will make the initializer invalid for olddecl in case it gets
assigned to olddecl below. */ assigned to olddecl below. */
DECL_INITIAL (newdecl) = 0; if (TREE_CODE (newdecl) == VAR_DECL)
DECL_INITIAL (newdecl) = 0;
} }
/* TLS cannot follow non-TLS declaration. */ /* TLS cannot follow non-TLS declaration. */
else if (TREE_CODE (olddecl) == VAR_DECL && TREE_CODE (newdecl) == VAR_DECL else if (TREE_CODE (olddecl) == VAR_DECL && TREE_CODE (newdecl) == VAR_DECL
......
2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr> 2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/decl-3.c: New test.
2003-03-12 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/i386-loop-2.c: New test. * gcc.dg/i386-loop-2.c: New test.
2003-03-11 Mark Mitchell <mark@codesourcery.com> 2003-03-11 Mark Mitchell <mark@codesourcery.com>
......
/* PR c/9928 */
/* { dg-do compile } */
enum { CODES }; /* { dg-error "previous declaration" } */
enum { CODES }; /* { dg-error "conflicting types" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment