This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Revert 2002-09-08 change to unroll.c


I've recently submitted three independent fixes to PR opt/6405.
However, many thanks to Dale Johannesen, further analysis reveals
that one of these fixes is potentially unsafe.  Although I've been
unable to trigger any problems, this change is certainly fragile
and could easily break mysteriously in the future.  Its been
decided that its best to undo the potentially harmful change.
Fortunately, the "triple redundancy" policy, means that PR 6405
is still fixed, so there's no reason to reopen the GNATS PR.

RTH puts my feelings into words better than I ever could:
> The first order of business for 3.4 is to merge the
> cfg-branch loop stuff, so that we don't have to worry
> about this kind of crap any more.


The following patch has been tested with a complete "make bootstrap"
and "make -k check", all languages except Ada and treelang, on
i686-pc-linux-gnu with no new regressions.  I've also confirmed by
hand that the PR optimization/6405 test case still gets unrolled.

Ok for mainline?


2002-09-28  Roger Sayle  <roger@eyesopen.com>

	* unroll.c (loop_iterations): Revert 2002-09-08 change.


Index: unroll.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/unroll.c,v
retrieving revision 1.178
diff -c -3 -p -r1.178 unroll.c
*** unroll.c	27 Sep 2002 22:41:07 -0000	1.178
--- unroll.c	28 Sep 2002 03:05:25 -0000
*************** loop_iterations (loop)
*** 3309,3315 ****
       accidentally get the branch for a contained loop if the branch for this
       loop was deleted.  We can only trust branches immediately before the
       loop_end.  */
!   last_loop_insn = prev_nonnote_insn (loop->end);

    /* ??? We should probably try harder to find the jump insn
       at the end of the loop.  The following code assumes that
--- 3309,3315 ----
       accidentally get the branch for a contained loop if the branch for this
       loop was deleted.  We can only trust branches immediately before the
       loop_end.  */
!   last_loop_insn = PREV_INSN (loop->end);

    /* ??? We should probably try harder to find the jump insn
       at the end of the loop.  The following code assumes that

Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]