From: Andrew Pinski Date: Tue, 22 Jun 2004 07:23:25 +0000 (+0000) Subject: Radar #: 3701874 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6bf7bb617bc7d39715803f8915c6b77316eac25;p=gcc.git Radar #: 3701874 2004-06-21 Andrew Pinski Radar #: 3701874 * c-decl.c (push_file_scope): Return early if we already have a file scope. 2004-06-21 Andrew Pinski * gcc.dg/pch/struct-1.c: New. * gcc.dg/pch/struct-1.hs: New. From-SVN: r83483 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 88a9d9575cb..8826c975252 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-06-21 Andrew Pinski + + Radar #: 3701874 + * c-decl.c (push_file_scope): Return early if we already + have a file scope. + 2004-06-21 Geoffrey Keating * c-opts.c (c_common_handle_option): Handle -fpch-preprocess. diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 4735dabf644..1f0db19e697 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -810,6 +810,9 @@ push_file_scope (void) { tree decl; + if (file_scope) + return; + push_scope (); file_scope = current_scope; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cbc1a4b8448..5a416441f3d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-06-21 Andrew Pinski + + * gcc.dg/pch/struct-1.c: New. + * gcc.dg/pch/struct-1.hs: New. + 2004-06-21 Geoffrey Keating * 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 index 00000000000..d6c03e7b84d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/struct-1.c @@ -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 index 00000000000..055353a8f6b --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/struct-1.hs @@ -0,0 +1,3 @@ +struct ChainSearchRecord; +typedef struct ChainSearchRecord *ChainSearchPtr; +