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]

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.


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