Tuesday, May 31, 2011

I'm looking at the crash today. I suspect that this is during the RTL-to-instrcution conversion. I've added a new expression to the mix, so maybe that code can't handle it properly.

Yep, that's the case. GCC dies in final_scan_insn() on the subreg expression I added.

Maybe not, I traced the crash down to a debug statement I put in earlier, apparently there is no debug file for the final pass, and so the debug fprintf's cause a crash. I just keep shooting myself in the foot with this debug output.

There's still a few minor bugs, and the MOVQI pattern needs more work, but I think this has some promise. I may need to rewrite all instructions and redo all testing once MOVQI is working. Oh boy...

Saturday, May 28, 2011

I've been busy, and haven't really had time for TI stuff lately. I did have bits of time here and there to fiddle with GCC, and in that time I got the 159r.combine step working. So now I'm looking into 172r.ira.

The subreg instructions are removed somewhere in reload(), but since that's represents a huge amount of work, I've got some spelunking ahead of me.

I had a lot more trouble finding reload() than I thought. It's called everywhere, but is located in reload1.c. I'm noting that fact here to possibly save some time later.

The next step is final.c::cleanup_subreg_operands(), called from reload(). That seems to delete the subreg expressions.

simplify_rtx.c::simplify_subreg() is the ultimate cause, which is called by final.c::alter_subreg(), which also makes some changes. But it looks like those changes don't matter for me.

I modified simplify_subreg() to explicitly emit a subreg expression if a word-to-byte conversion is used. That RTL expression seems to be preserved until 201r.shorten. At that point, there's a segmentation fault in GCC. Getting closer...