aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-decl.c1
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20041005-1.c6
4 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 71aa4a9..71f86e0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index cd003a3..415a757 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -2046,6 +2046,7 @@ pushdecl (tree x)
just need to fall through to make the declaration in
this scope. */
nested = true;
+ x = visdecl;
}
else
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8849504..b95a6ee 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/gcc.c-torture/compile/20041005-1.c b/gcc/testsuite/gcc.c-torture/compile/20041005-1.c
new file mode 100644
index 0000000..b0a6511
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20041005-1.c
@@ -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; }