From f0fc0803eacde9850a7ff4a12d2f4ad29f1bcb2c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 30 Jul 2010 16:36:56 +0200 Subject: re PR debug/45055 (another -fcompare-debug failure with uninitialised read in walk_gimple_stmt) PR debug/45055 PR rtl-optimization/45137 * rtl.h (prev_nonnote_nondebug_insn, next_nonnote_nondebug_insn): New prototypes. * emit-rtl.c (prev_nonnote_nondebug_insn, next_nonnote_nondebug_insn): New functions. * combine.c (next_nonnote_nondebug_insn): Removed. * ifcvt.c (noce_process_if_block): Use prev_nonnote_nondebug_insn. * haifa-sched.c (queue_to_ready): Use next_nonnote_nondebug_insn. * sched-deps.c (sched_analyze_insn): Likewise. (fixup_sched_groups, deps_start_bb): Use prev_nonnote_nondebug_insn. * rtlanal.c (canonicalize_condition): Likewise. * postreload.c (reload_combine_recognize_pattern): Likewise. (reload_cse_move2add): Use next_nonnote_nondebug_insn. * gcc.dg/pr45055.c: New test. From-SVN: r162714 --- gcc/emit-rtl.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'gcc/emit-rtl.c') diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 32741dc..fe8de9b 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3135,6 +3135,38 @@ prev_nondebug_insn (rtx insn) return insn; } +/* Return the next insn after INSN that is not a NOTE nor DEBUG_INSN. + This routine does not look inside SEQUENCEs. */ + +rtx +next_nonnote_nondebug_insn (rtx insn) +{ + while (insn) + { + insn = NEXT_INSN (insn); + if (insn == 0 || (!NOTE_P (insn) && !DEBUG_INSN_P (insn))) + break; + } + + return insn; +} + +/* Return the previous insn before INSN that is not a NOTE nor DEBUG_INSN. + This routine does not look inside SEQUENCEs. */ + +rtx +prev_nonnote_nondebug_insn (rtx insn) +{ + while (insn) + { + insn = PREV_INSN (insn); + if (insn == 0 || (!NOTE_P (insn) && !DEBUG_INSN_P (insn))) + break; + } + + return insn; +} + /* Return the next INSN, CALL_INSN or JUMP_INSN after INSN; or 0, if there is none. This routine does not look inside SEQUENCEs. */ -- cgit v1.1