From df8992f8f3270619b200bd065b3da9de118efc77 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 27 Dec 2001 14:19:59 -0800 Subject: haifa-sched.c (reemit_other_notes): New. * haifa-sched.c (reemit_other_notes): New. (schedule_block): Use it. * sched-ebb.c (schedule_ebbs): Call remove_unnecessary_notes. * sched-rgn.c (schedule_insns): Likewise. * cfglayout.c (remove_scope_notes): Handle removing note at the end of the insn chain. * function.c (debug_find_var_in_block_tree): New. * gcc.dg/debug-1.c, gcc.dg/debug-2.c: New. From-SVN: r48333 --- gcc/function.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'gcc/function.c') diff --git a/gcc/function.c b/gcc/function.c index f5a3102..097aea4 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -277,6 +277,7 @@ static void reorder_fix_fragments PARAMS ((tree)); static tree blocks_nreverse PARAMS ((tree)); static int all_blocks PARAMS ((tree, tree *)); static tree *get_block_vector PARAMS ((tree, int *)); +extern tree debug_find_var_in_block_tree PARAMS ((tree, tree)); /* We always define `record_insns' even if its not used so that we can always export `prologue_epilogue_contains'. */ static void record_insns PARAMS ((rtx, varray_type *)) ATTRIBUTE_UNUSED; @@ -6051,6 +6052,29 @@ number_blocks (fn) return; } + +/* If VAR is present in a subblock of BLOCK, return the subblock. */ + +tree +debug_find_var_in_block_tree (var, block) + tree var; + tree block; +{ + tree t; + + for (t = BLOCK_VARS (block); t; t = TREE_CHAIN (t)) + if (t == var) + return block; + + for (t = BLOCK_SUBBLOCKS (block); t; t = TREE_CHAIN (t)) + { + tree ret = debug_find_var_in_block_tree (var, t); + if (ret) + return ret; + } + + return NULL_TREE; +} /* Allocate a function structure and reset its contents to the defaults. */ -- cgit v1.1