From: Eric Botcazou Date: Wed, 12 Mar 2003 10:04:52 +0000 (+0100) Subject: re PR c/9928 (ICE on duplicate enum declaration) X-Git-Tag: releases/gcc-3.2.3~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=281715d3260b99764f29116463026114c22cc4d9;p=thirdparty%2Fgcc.git 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: r64239 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 031a1b34494a..4fecda4cae93 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-03-12 Eric Botcazou + + 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 PR optimization/9888 diff --git a/gcc/c-decl.c b/gcc/c-decl.c index ea02f2665569..9e05251c1047 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1670,7 +1670,8 @@ duplicate_decls (newdecl, olddecl, different_binding_level) to variables that were declared between olddecl and newdecl. This will make the initializer invalid for olddecl in case it gets assigned to olddecl below. */ - DECL_INITIAL (newdecl) = 0; + if (TREE_CODE (newdecl) == VAR_DECL) + DECL_INITIAL (newdecl) = 0; } else { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7d877607d4de..9a21126ef5e8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2003-03-12 Eric Botcazou + + * gcc.dg/decl-3.c: New test. + 2003-03-12 Eric Botcazou * gcc.dg/i386-loop-2.c: New test. @@ -11980,3 +11984,4 @@ Mon Mar 22 14:28:46 1993 Ian Lance Taylor (ian@cygnus.com) correspond to c-torture 1.11. * New file. +