This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch 3.1 fix enable-checking failure unroll.c
- From: Graham Stott <grahams at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 26 Feb 2002 17:32:31 +0000
- Subject: patch 3.1 fix enable-checking failure unroll.c
All,
Building a xstormy16-elf cross compiler with enable-checking=rtl,
misc,tree enabled failed unroll.c (loop_iterations) because INTVAL
was being applied to a REG.
The add_val for a BIV maybe a CONST_INT or REG.
This patch fixes the xstormy16-elf abort but a complete build
was not sucessfull due to other problems later (unrecognised insn).
Bootstrapped i686-pc-linux-gnu all languages no regressions.
OK for 3.1 and mainline?
Graham
ChangeLog
* loop.c (loop_iterations): Return 0 if the add_val for
a BIV is REG.
-------------------------------------------------------------------
Index: unroll.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unroll.c,v
retrieving revision 1.160
diff -c -p -r1.160 unroll.c
*** unroll.c 2002/01/25 21:46:07 1.160
--- unroll.c 2002/02/26 16:43:24
*************** loop_iterations (loop)
*** 3744,3750 ****
for (biv_inc = bl->biv; biv_inc; biv_inc = biv_inc->next_iv)
{
if (loop_insn_first_p (v->insn, biv_inc->insn))
! offset -= INTVAL (biv_inc->add_val);
}
}
if (loop_dump_stream)
--- 3744,3761 ----
for (biv_inc = bl->biv; biv_inc; biv_inc = biv_inc->next_iv)
{
if (loop_insn_first_p (v->insn, biv_inc->insn))
! {
! if (REG_P (biv_inc->add_val))
! {
! if (loop_dump_stream)
! fprintf (loop_dump_stream,
! "Loop iterations: Basic induction var add_val is REG %d.\n",
! REGNO (biv_inc->add_val));
! return 0;
! }
!
! offset -= INTVAL (biv_inc->add_val);
! }
}
}
if (loop_dump_stream)
----------------------------------------------------------------------