From c5c62c710eb88e902926ee330942c2f46c628f26 Mon Sep 17 00:00:00 2001 From: "J\"orn Rennecke" Date: Mon, 9 Feb 1998 21:15:14 +0000 Subject: [PATCH] c-decl.c (grokdeclarator): Get parameter tags from last_function_parm_tags. * c-decl.c (grokdeclarator): Get parameter tags from last_function_parm_tags. * dwarfout.c (output_formal_types): Set TREE_ASM_WRITTEN before traversing the parameter types. (output_type): No early exit for FUNCTION_TYPE / METHOD_TYPE context. From-SVN: r17811 --- gcc/ChangeLog | 8 ++++++++ gcc/c-decl.c | 2 +- gcc/dwarfout.c | 12 +++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 56caf507a792..5f7c7fa457ff 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +Mon Feb 9 22:16:04 1998 J"orn Rennecke + + * c-decl.c (grokdeclarator): Get parameter tags from + last_function_parm_tags. + * dwarfout.c (output_formal_types): Set TREE_ASM_WRITTEN before + traversing the parameter types. + (output_type): No early exit for FUNCTION_TYPE / METHOD_TYPE context. + Mon Feb 9 22:10:58 1998 Todd Vierling * fixincludes: Tweak fix for struct exception in math.h diff --git a/gcc/c-decl.c b/gcc/c-decl.c index e38cdb15a89a..468ab2c99681 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4827,7 +4827,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) { register tree link; - for (link = current_function_parm_tags; + for (link = last_function_parm_tags; link; link = TREE_CHAIN (link)) TYPE_CONTEXT (TREE_VALUE (link)) = type; diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index c3d7f82ce745..c259280e8fb9 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -3988,6 +3988,12 @@ output_formal_types (function_or_method_type) register tree formal_type = NULL; register tree first_parm_type = TYPE_ARG_TYPES (function_or_method_type); + /* Set TREE_ASM_WRITTEN while processing the parameters, lest we + get bogus recursion when outputting tagged types local to a + function declaration. */ + int save_asm_written = TREE_ASM_WRITTEN (function_or_method_type); + TREE_ASM_WRITTEN (function_or_method_type) = 1; + /* In the case where we are generating a formal types list for a C++ non-static member function type, skip over the first thing on the TYPE_ARG_TYPES list because it only represents the type of the @@ -4033,6 +4039,8 @@ output_formal_types (function_or_method_type) output_type (formal_type, function_or_method_type); } + + TREE_ASM_WRITTEN (function_or_method_type) = save_asm_written; } /* Remember a type in the pending_types_list. */ @@ -4323,7 +4331,9 @@ output_type (type, containing_scope) if (TYPE_SIZE (type) == 0 && (TYPE_CONTEXT (type) == NULL - || TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't') + || (TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't' + && TREE_CODE (TYPE_CONTEXT (type)) != FUNCTION_TYPE + && TREE_CODE (TYPE_CONTEXT (type)) != METHOD_TYPE)) && !finalizing) return; /* EARLY EXIT! Avoid setting TREE_ASM_WRITTEN. */ -- 2.47.2