aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-10-05 20:54:26 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2004-10-05 20:54:26 +0100
commit1b36c8183586b92176cd67dc2250623632120a4c (patch)
treefd7f6fee9d8f05210df58bc5a67a9559ca8f660e /gcc
parent95740bfc809797d22f2597582df641daf537e38e (diff)
downloadgcc-1b36c8183586b92176cd67dc2250623632120a4c.zip
gcc-1b36c8183586b92176cd67dc2250623632120a4c.tar.gz
gcc-1b36c8183586b92176cd67dc2250623632120a4c.tar.bz2
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
Diffstat (limited to 'gcc')
-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; }