diff options
author | Steven Bosscher <s.bosscher@student.tudelft.nl> | 2003-02-22 06:35:28 +0100 |
---|---|---|
committer | Andreas Jaeger <aj@gcc.gnu.org> | 2003-02-22 06:35:28 +0100 |
commit | b65538149bb5d374aa7d5082500f64886a4dfb23 (patch) | |
tree | a37986796fe69ede4e085f84ad5dffcbdbc662c1 /gcc | |
parent | 26182e150e12399cdd151a70f46e3c937add775c (diff) | |
download | gcc-b65538149bb5d374aa7d5082500f64886a4dfb23.zip gcc-b65538149bb5d374aa7d5082500f64886a4dfb23.tar.gz gcc-b65538149bb5d374aa7d5082500f64886a4dfb23.tar.bz2 |
re PR c/8828 (gcc reports some code is unreachable when it is not)
2003-02-22 Steven Bosscher <s.bosscher@student.tudelft.nl>
PR c/8828
* jump.c (never_reached_warning): Don't fall through BARRRIER
insns. Update comments to reflect what the function really does.
From-SVN: r63275
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/jump.c | 27 |
2 files changed, 16 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ebbfaaf..249d0f5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -4,8 +4,8 @@ * toplev.c (process_options): If flag_detailed_statistics is set, then set time_report as well. - PR c/8828 - * jump.c (never_reached_warning): Don't fall through BARRRIER + PR c/8828 + * jump.c (never_reached_warning): Don't fall through BARRRIER insns. Update comments to reflect what the function really does. 2003-02-21 Roger Sayle <roger@eyesopen.com> @@ -1706,9 +1706,9 @@ delete_computation (insn) } /* Delete insn INSN from the chain of insns and update label ref counts - and delete insns now unreachable. + and delete insns now unreachable. - Returns the first insn after INSN that was not deleted. + Returns the first insn after INSN that was not deleted. Usage of this instruction is deprecated. Use delete_insn instead and subsequent cfg_cleanup pass to delete unreachable code if needed. */ @@ -1893,14 +1893,14 @@ delete_for_peephole (from, to) is also an unconditional jump in that case. */ } -/* We have determined that INSN is never reached, and are about to - delete it. Print a warning if the user asked for one. +/* We have determined that AVOIDED_INSN is never reached, and are + about to delete it. If the insn chain between AVOIDED_INSN and + FINISH contains more than one line from the current function, and + contains at least one operation, print a warning if the user asked + for it. If FINISH is NULL, look between AVOIDED_INSN and a LABEL. - To try to make this warning more useful, this should only be called - once per basic block not reached, and it only warns when the basic - block contains more than one line from the current function, and - contains at least one operation. CSE and inlining can duplicate insns, - so it's possible to get spurious warnings from this. */ + CSE and inlining can duplicate insns, so it's possible to get + spurious warnings from this. */ void never_reached_warning (avoided_insn, finish) @@ -1910,15 +1910,16 @@ never_reached_warning (avoided_insn, finish) rtx a_line_note = NULL; int two_avoided_lines = 0, contains_insn = 0, reached_end = 0; - if (! warn_notreached) + if (!warn_notreached) return; - /* Scan forwards, looking at LINE_NUMBER notes, until - we hit a LABEL or we run out of insns. */ + /* Scan forwards, looking at LINE_NUMBER notes, until we hit a LABEL + in case FINISH is NULL, otherwise until we run out of insns. */ for (insn = avoided_insn; insn != NULL; insn = NEXT_INSN (insn)) { - if (finish == NULL && GET_CODE (insn) == CODE_LABEL) + if ((finish == NULL && GET_CODE (insn) == CODE_LABEL) + || GET_CODE (insn) == BARRIER) break; if (GET_CODE (insn) == NOTE /* A line number note? */ |