From: Jim Wilson Date: Tue, 16 Mar 1993 20:11:12 +0000 (-0800) Subject: (grokdeclarator, ARRARY_REF): If exern, then end X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e0e2f469f61bab4770d0b3ffc8eb285633ecf13c;p=gcc.git (grokdeclarator, ARRARY_REF): If exern, then end temporary allocation before building type. From-SVN: r3760 --- diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 80844596da8..22056c9a7e0 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. */