c-decl.c (pushdecl): When an extern declaration at block scope refers to a visible entity with...

* c-decl.c (pushdecl): When an extern declaration at block scope
	refers to a visible entity with internal linkage, use the old DECL
	rather than the new one.

testsuite:
	* gcc.c-torture/compile/20041005-1.c: New test.

From-SVN: r88570
This commit is contained in:
Joseph Myers 2004-10-05 20:54:26 +01:00 committed by Joseph Myers
parent 95740bfc80
commit 1b36c81835
4 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk>
* c-decl.c (pushdecl): When an extern declaration at block scope
refers to a visible entity with internal linkage, use the old DECL
rather than the new one.
2004-10-05 Kazu Hirata <kazu@cs.umass.edu>
* tree-cfg.c (cleanup_tree_cfg): Remove extra parentheses in

View File

@ -2046,6 +2046,7 @@ pushdecl (tree x)
just need to fall through to make the declaration in
this scope. */
nested = true;
x = visdecl;
}
else
{

View File

@ -1,3 +1,7 @@
2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk>
* gcc.c-torture/compile/20041005-1.c: New test.
2004-10-05 Nathan Sidwell <nathan@codesourcery.com>
PR c++/17829

View File

@ -0,0 +1,6 @@
/* This wrongly caused duplicate definitions of x in the assembler
output. */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
static int x = 1;
void f (void) { extern int x; }