Radar #: 3701874
authorAndrew Pinski <apinski@apple.com>
Tue, 22 Jun 2004 07:23:25 +0000 (07:23 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Tue, 22 Jun 2004 07:23:25 +0000 (00:23 -0700)
2004-06-21  Andrew Pinski  <apinski@apple.com>

        Radar #: 3701874
        * c-decl.c (push_file_scope): Return early if we already
        have a file scope.

2004-06-21  Andrew Pinski  <apinski@apple.com>

        * gcc.dg/pch/struct-1.c: New.
        * gcc.dg/pch/struct-1.hs: New.

From-SVN: r83483

gcc/ChangeLog
gcc/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pch/struct-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pch/struct-1.hs [new file with mode: 0644]

index 88a9d9575cb88e5f4fb5a719edf5e07dfab4f904..8826c9752529f05ceac2d1b7ad5e8eaeebe81a69 100644 (file)
@@ -1,3 +1,9 @@
+2004-06-21  Andrew Pinski  <apinski@apple.com>
+
+       Radar #: 3701874
+       * c-decl.c (push_file_scope): Return early if we already
+       have a file scope.
+
 2004-06-21  Geoffrey Keating  <geoffk@apple.com>
 
        * c-opts.c (c_common_handle_option): Handle -fpch-preprocess.
index 4735dabf6448037b94bc2a9b9840e1131d88246a..1f0db19e697a677f6db4d8ab9c0baf4cc7050d50 100644 (file)
@@ -810,6 +810,9 @@ push_file_scope (void)
 {
   tree decl;
 
+  if (file_scope)
+    return;
+
   push_scope ();
   file_scope = current_scope;
 
index cbc1a4b8448150a5b9648ff6f3ffeb9de53ab9fc..5a416441f3d245374684c99c66b30a285fd39ce2 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-21  Andrew Pinski  <apinski@apple.com>
+
+       * gcc.dg/pch/struct-1.c: New.
+       * gcc.dg/pch/struct-1.hs: New.
+
 2004-06-21  Geoffrey Keating  <geoffk@apple.com>
 
        * gcc.dg/pch/save-temps-1.c: New file.
diff --git a/gcc/testsuite/gcc.dg/pch/struct-1.c b/gcc/testsuite/gcc.dg/pch/struct-1.c
new file mode 100644 (file)
index 0000000..d6c03e7
--- /dev/null
@@ -0,0 +1,11 @@
+#include "struct-1.h"
+
+struct ChainSearchRecord {
+ int identity;
+};
+typedef struct ChainSearchRecord ChainSearchRecord;
+void foo (ChainSearchPtr s)
+{
+  s->identity = 0x6a73616d;
+}
+
diff --git a/gcc/testsuite/gcc.dg/pch/struct-1.hs b/gcc/testsuite/gcc.dg/pch/struct-1.hs
new file mode 100644 (file)
index 0000000..055353a
--- /dev/null
@@ -0,0 +1,3 @@
+struct ChainSearchRecord;
+typedef struct ChainSearchRecord *ChainSearchPtr;
+