This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
mainline regression (was Re: [PATCH] Prevent ifcvt from movingcomputations into loop)
- From: "David S. Miller" <davem at redhat dot com>
- To: rakdver at atrey dot karlin dot mff dot cuni dot cz
- Cc: rth at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Sat, 19 Jul 2003 04:21:49 -0700
- Subject: mainline regression (was Re: [PATCH] Prevent ifcvt from movingcomputations into loop)
With the addition of this change:
* Makefile.in (ifcvt.o): Add cfgloop.h.
* basic-block.h (EDGE_LOOP_EXIT): New flag.
* cfgrtl.c (rtl_verify_flow_info_1): Handle it correctly.
* ifcvt.c: Include cfgloop.h.
(mark_loop_exit_edges): New static function.
(if_convert): Call it.
(find_if_header): Ignore branches out of loops.
mainline now gets into infinite loops for a significant portion
of the testsuite on sparc64-linux-gnu, but I have a feeling that
this problem is going to be seen on other targets too. The whole
bootstrap build succeeds which is pretty amusing :-)
One example failure is gcc.c-torture/compile/20011229-2.c at any
optimization level greater than or equal to -O2.
The compiler, when it hangs in the infinite loop, is in
sched-rgn.c:find_rgns(), in the first DFS traversal loop near line
675.
The state is that sp == -1, current_edge == 0, and we keep looping
infinitely at this top part of the loop without making any further
progress. current_edge was initialized to out_edges[0] which is
zero.
So every time through this loop current_edge == 0 so the first
test passes, the inner while loop never executes since sp is < 0,
and since TEST_BIT (passed, current_edge) cannot be true for any
value of 'passed' we execute the continue statement and do the
same thing all over again.