* 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
+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
just need to fall through to make the declaration in
this scope. */
nested = true;
+ x = visdecl;
}
else
{
+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
--- /dev/null
+/* 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; }