From: Jason Merrill Date: Fri, 8 Jun 2001 18:12:54 +0000 (-0400) Subject: stmt.c (current_nesting_level): New fn. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=91088ddb810837c123b010796ec85bed37a5f78b;p=gcc.git stmt.c (current_nesting_level): New fn. * stmt.c (current_nesting_level): New fn. * tree.h: Declare it. * c-semantics.c (genrtl_compound_stmt): Use it. * dbxout.c (dbxout_symbol): Use DECL_RTL_SET_P. From-SVN: r43037 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2bcea06f39a..984633dcb03 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2001-06-08 Jason Merrill + + * stmt.c (current_nesting_level): New fn. + * tree.h: Declare it. + * c-semantics.c (genrtl_compound_stmt): Use it. + + * dbxout.c (dbxout_symbol): Use DECL_RTL_SET_P. + 2001-06-08 Jakub Jelinek * jump.c (mark_modified_reg): Allow jump threading if condition @@ -134,7 +142,6 @@ Thu Jun 7 16:17:40 2001 Richard Kenner documentation should be added to invoke.texi. Avoid an overfull hbox. ->>>>>>> 1.10276 Thu Jun 7 17:09:50 CEST 2001 Jan Hubicka * toplev.c (rest_of_compilation): Revert previous patch. @@ -169,6 +176,7 @@ Thu Jun 7 12:12:58 CEST 2001 Jan Hubicka * emit-rtl.c (operand_subword): Remove unused variable. +>>>>>>> 1.10284 Wed Jun 6 14:51:05 CEST 2001 Jan Hubicka * i386.md (floatdi?f): Avoid usinf of SSE instructions diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c index 63b4b14fad5..6a963a9a10e 100644 --- a/gcc/c-semantics.c +++ b/gcc/c-semantics.c @@ -666,7 +666,17 @@ void genrtl_compound_stmt (t) tree t; { +#ifdef ENABLE_CHECKING + struct nesting *n = current_nesting_level (); +#endif + expand_stmt (COMPOUND_BODY (t)); + +#ifdef ENABLE_CHECKING + /* Make sure that we've pushed and popped the same number of levels. */ + if (n != current_nesting_level ()) + abort (); +#endif } /* Generate the RTL for an ASM_STMT. */ diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 6648727f0c1..ee51faecde0 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -1816,7 +1816,7 @@ dbxout_symbol (decl, local) case RESULT_DECL: /* Named return value, treat like a VAR_DECL. */ case VAR_DECL: - if (DECL_RTL (decl) == 0) + if (! DECL_RTL_SET_P (decl)) return 0; /* Don't mention a variable that is external. Let the file that defines it describe it. */ diff --git a/gcc/stmt.c b/gcc/stmt.c index c20a99e6ad2..3cefc7ce3ee 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -3395,6 +3395,15 @@ conditional_context () return block_stack && block_stack->data.block.conditional_code; } +/* Return an opaque pointer to the current nesting level, so frontend code + can check its own sanity. */ + +struct nesting * +current_nesting_level () +{ + return cfun ? block_stack : 0; +} + /* Emit a handler label for a nonlocal goto handler. Also emit code to store the handler label in SLOT before BEFORE_INSN. */ diff --git a/gcc/tree.h b/gcc/tree.h index 8f29728849b..7805ef8987b 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -2567,6 +2567,7 @@ extern void end_cleanup_deferral PARAMS ((void)); extern int is_body_block PARAMS ((tree)); extern int conditional_context PARAMS ((void)); +extern struct nesting * current_nesting_level PARAMS ((void)); extern tree last_cleanup_this_contour PARAMS ((void)); extern void expand_start_case PARAMS ((int, tree, tree, const char *));