From 1db88ef97966a671405ab7d165e1b11fa1e2bc61 Mon Sep 17 00:00:00 2001 From: Franz Sirl Date: Thu, 28 Sep 2000 22:36:49 +0000 Subject: [PATCH] doloop.c (doloop_modify): Prevent delete_insn() from deleting too much. 2000-09-28 Franz Sirl * doloop.c (doloop_modify): Prevent delete_insn() from deleting too much. Prefer loop->top over loop->start as target for the new JUMP insn. (doloop_valid_p): Ignore loop with exit_count != 0. From-SVN: r36661 --- gcc/ChangeLog | 16 ++++++++++++++++ gcc/doloop.c | 12 +++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3d71284e373..fa0d22d80a7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2000-09-28 Franz Sirl + * doloop.c (doloop_modify): Prevent delete_insn() from + deleting too much. Prefer loop->top over loop->start as + target for the new JUMP insn. + (doloop_valid_p): Ignore loop with exit_count != 0. + 2000-09-28 Philipp Thomas * invoke.texi (i386 Options): Add athlon to table of possible @@ -2674,6 +2680,16 @@ Sat Sep 2 13:58:23 2000 Marek Michalkiewicz * config/avr/avr.md ("*negsi2"): substitute %@ to __zero_reg__ * config/avr/libgcc.S: Lost part of the previous patch. +2000-08-31 Franz Sirl + + * rs6000/rs6000.h (NO_DOLLAR_IN_LABEL, DOLLARS_IN_IDENTIFIERS, + ENCODE_SECTION_INFO, ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Move from + here... + * rs6000/aix.h: ...to here. + * rs6000/linux.h (ASM_APP_ON, ASM_APP_OFF): Define to Linux-style. + * rs6000/rs6000.c (rs6000_select_section): Handle CONSTRUCTOR. + (rs6000_unique_section): Likewise. + 2000-08-31 J. David Anglin * gthr-dce.h (__gthread_objc_mutex_allocate): Create a pthread_mutex_t diff --git a/gcc/doloop.c b/gcc/doloop.c index cb2b67bf49e..191cdf0cf37 100644 --- a/gcc/doloop.c +++ b/gcc/doloop.c @@ -281,7 +281,7 @@ doloop_valid_p (loop, jump_insn) statement within a loop will generate multiple loop exits. Another example of a loop that currently generates multiple exit targets is for (i = 0; i < (foo ? 8 : 4); i++) { }. */ - if (loop_info->has_multiple_exit_targets) + if (loop_info->has_multiple_exit_targets || loop->exit_count) { if (loop_dump_stream) fprintf (loop_dump_stream, @@ -415,14 +415,16 @@ doloop_modify (loop, iterations, iterations_max, fputs (" iterations).", loop_dump_stream); } + /* Emit the label that will delimit the top of the loop. + This has to be done before the delete_insn call below, to prevent + delete_insn from deleting too much. */ + emit_label_after (start_label, loop->top ? loop->top : loop->start); + LABEL_NUSES (start_label)++; + /* Discard original jump to continue loop. The original compare result may still be live, so it cannot be discarded explicitly. */ delete_insn (jump_insn); - /* Emit the label that will delimit the start of the loop. */ - emit_label_after (start_label, loop->start); - LABEL_NUSES (start_label)++; - counter_reg = XEXP (condition, 0); if (GET_CODE (counter_reg) == PLUS) counter_reg = XEXP (counter_reg, 0);