aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranz Sirl <Franz.Sirl-kernel@lauterbach.com>2000-09-29 17:38:25 +0000
committerFranz Sirl <sirl@gcc.gnu.org>2000-09-29 17:38:25 +0000
commit70dd0f7f41c65dd4162cc5184c519bfbec805cfb (patch)
tree455b4ac10185b5208cea4d031dfc4e4e6be5f066
parent0c6129af811f88b0ebabc443a29fb88ea44b52aa (diff)
downloadgcc-70dd0f7f41c65dd4162cc5184c519bfbec805cfb.zip
gcc-70dd0f7f41c65dd4162cc5184c519bfbec805cfb.tar.gz
gcc-70dd0f7f41c65dd4162cc5184c519bfbec805cfb.tar.bz2
loop.c (check_final_value): A GIV is not replaceable if used before set.
2000-09-29 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> * loop.c (check_final_value): A GIV is not replaceable if used before set. From-SVN: r36668
-rw-r--r--gcc/ChangeLog16
-rw-r--r--gcc/loop.c25
2 files changed, 20 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2a32857..86baecc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-09-29 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ * loop.c (check_final_value): A GIV is not replaceable if used
+ before set.
+
Fri Sep 29 10:04:12 2000 Jeffrey A Law (law@cygnus.com)
* version.c: Bump to gcc-2.97.
@@ -62,6 +67,7 @@ Fri Sep 29 13:20:42 MET DST 2000 Jan Hubicka <jh@suse.cz>
* configure: Rebuilt.
2000-09-28 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
* doloop.c (doloop_modify): Prevent delete_insn() from
deleting too much. Prefer loop->top over loop->start as
target for the new JUMP insn.
@@ -2743,16 +2749,6 @@ Sat Sep 2 13:58:23 2000 Marek Michalkiewicz <marekm@linux.org.pl>
* config/avr/avr.md ("*negsi2"): substitute %@ to __zero_reg__
* config/avr/libgcc.S: Lost part of the previous patch.
-2000-08-31 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
-
- * 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 <dave@hiauly1.hia.nrc.ca>
* gthr-dce.h (__gthread_objc_mutex_allocate): Create a pthread_mutex_t
diff --git a/gcc/loop.c b/gcc/loop.c
index b53b148..f685b39 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -5094,6 +5094,7 @@ check_final_value (loop, v)
or all uses follow that insn in the same basic block),
- its final value can be calculated (this condition is different
than the one above in record_giv)
+ - it's not used before the it's set
- no assignments to the biv occur during the giv's lifetime. */
#if 0
@@ -5105,7 +5106,7 @@ check_final_value (loop, v)
if ((final_value = final_giv_value (loop, v))
&& (v->always_computable || last_use_this_basic_block (v->dest_reg, v->insn)))
{
- int biv_increment_seen = 0;
+ int biv_increment_seen = 0, before_giv_insn = 0;
rtx p = v->insn;
rtx last_giv_use;
@@ -5135,7 +5136,10 @@ check_final_value (loop, v)
{
p = NEXT_INSN (p);
if (p == loop->end)
- p = NEXT_INSN (loop->start);
+ {
+ before_giv_insn = 1;
+ p = NEXT_INSN (loop->start);
+ }
if (p == v->insn)
break;
@@ -5153,7 +5157,7 @@ check_final_value (loop, v)
if (reg_mentioned_p (v->dest_reg, PATTERN (p)))
{
- if (biv_increment_seen)
+ if (biv_increment_seen || before_giv_insn)
{
v->replaceable = 0;
v->not_replaceable = 1;
@@ -5438,14 +5442,13 @@ basic_induction_var (loop, x, mode, dest_reg, p, inc_val, mult_val, location)
<= UNITS_PER_WORD)
&& (GET_MODE_CLASS (GET_MODE (SET_DEST (set)))
== MODE_INT)
- && SUBREG_REG (SET_DEST (set)) == x))
- && basic_induction_var (loop, SET_SRC (set),
- (GET_MODE (SET_SRC (set)) == VOIDmode
- ? GET_MODE (x)
- : GET_MODE (SET_SRC (set))),
- dest_reg, insn,
- inc_val, mult_val, location))
- return 1;
+ && SUBREG_REG (SET_DEST (set)) == x)))
+ return basic_induction_var (loop, SET_SRC (set),
+ (GET_MODE (SET_SRC (set)) == VOIDmode
+ ? GET_MODE (x)
+ : GET_MODE (SET_SRC (set))),
+ dest_reg, insn,
+ inc_val, mult_val, location);
}
/* Fall through. */