diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1993-03-16 12:11:12 -0800 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1993-03-16 12:11:12 -0800 |
commit | e0e2f469f61bab4770d0b3ffc8eb285633ecf13c (patch) | |
tree | 2263434996701a9d793e6898bb87f594ca267880 | |
parent | fe1f7f2437901f1aed2d959ffcda437fd95fa758 (diff) | |
download | gcc-e0e2f469f61bab4770d0b3ffc8eb285633ecf13c.zip gcc-e0e2f469f61bab4770d0b3ffc8eb285633ecf13c.tar.gz gcc-e0e2f469f61bab4770d0b3ffc8eb285633ecf13c.tar.bz2 |
(grokdeclarator, ARRARY_REF): If exern, then end
temporary allocation before building type.
From-SVN: r3760
-rw-r--r-- | gcc/c-decl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 8084459..22056c9 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4033,6 +4033,8 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) { register tree itype = NULL_TREE; register tree size = TREE_OPERAND (declarator, 1); + /* An uninitialized decl with `extern' is a reference. */ + int extern_ref = !initialized && (specbits & (1 << (int) RID_EXTERN)); declarator = TREE_OPERAND (declarator, 0); @@ -4056,6 +4058,12 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) if (type == error_mark_node) continue; + /* If this is a block level extern, it must live past the end + of the function so that we can check it against other extern + declarations (IDENTIFIER_LIMBO_VALUE). */ + if (extern_ref && allocation_temporary_p ()) + end_temporary_allocation (); + /* If size was specified, set ITYPE to a range-type for that size. Otherwise, ITYPE remains null. finish_decl may figure it out from an initial value. */ |