flow.c bugfix

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Wed Dec 2 07:10:00 GMT 1998


At 08:17 02.12.98 , Jeffrey A Law wrote:
>
>Boy was this fun!
>
>Under certain circumstances we can get an RTL chain with bogus "next"
>pointers.
>
>In the case I was looking at this bogus next pointer caused the haifa
>scheduler to blow up because it wanted to traverse forwards from the start
>of a block to the end of the block.
>
>basic_block_end for the block in question referenced an insn which could
>not be reached by following next pointers.  Odd since it would be rather
>difficult to set basic_block_end to an insn that can't be reached via the
>next pointers in the rtl chain.
>
>Eventually I tracked the bogon basic_block_end entry to the generic code
>to handle rtl prologues and epilogues.
>
>For the epilogue it basically stuffs whatever the machine dependent code
>generates after "last_insn", then updates basic_block_end for the last
>basic block to point to the last instruction in the epilgoue.
>
>After a while it finally occurred to me that "last_insn" was totally bogus --
>it couldn't be reached by following the chain of next pointers in the RTL
>either.
>
>Much head scratching later I finally came across a hunk of code which would
>splice insns out of the rtl chain, but not update last_insn.  Ugh.
>
>I've installed this patch to fix the problem.  Presumably we don't have
>the same problem for the first insn in the chain since the first block is
>always reachable.
>
>	* flow.c (delete_block): Call set_last_insn if we end up deleting the
>	last insn in the rtl chain.


This one seems to cause a regression on powerpc-unknown-linux-gnu:

spawn /home/fsirl/obj/cvsm/gcc/testsuite/../xgcc
-B/home/fsirl/obj/cvsm/gcc/testsuite/../
/home/fsirl/egcsm/gcc/testsuite/g++.old-
deja/g++.mike/unroll1.C -g -O -funroll-loops -I/home/fsirl/egcsm/libio
-I/home/fsirl/obj/cvsm/ppc-redhat-linux/libio -I/home/fsirl
/egcsm/libstdc++ -I/home/fsirl/egcsm/libstdc++/stl
-I/home/fsirl/obj/cvsm/gcc/testsuite/../include -c -o /home/fsirl/obj/cvsm/gcc/
testsuite/unroll1.o 
../../../egcsm/gcc/emit-rtl.c:1928: Internal compiler error in function
set_last_insn
compiler exited with status 1
output is:
../../../egcsm/gcc/emit-rtl.c:1928: Internal compiler error in function
set_last_insn
FAIL: g++.mike/unroll1.C caused compiler crash

I have the DWARF EH patches from Andrew, the -fPIC patch from rth and my
patch to fully enable ASM_OUTPUT_MI_THUNK on PPC installed, but I don't
think they cause this regression as all was fine with the same setup on Sunday.

Tell me if you need more details.

Franz.




More information about the Gcc-patches mailing list