Alas, enable-checking produced no different result or additional warnings or errors (though it might help me in the future!)

I have a work around but don't fully understand why a define_expand should
have caused segmentation fault.

I believe the issue might be that gcse does not expect to see any POST_INC patterns in its first pass. (The RTL dump files show that is where it died.) A few are normally created by patterns - but perhaps almost all restricted to prolog/epilog. In my case, I used define_expand so it appears in very earliest RTL, in a normal block. Most POST_INC/DEC etc are created after gcse pass. (by auto-inc-dec pass of course).

The expander used

rtx tmp_reg_rtx = copy_to_mode_reg (QImode,gen_rtx_MEM (QImode,gen_rtx_POST_INC (HImode, addr1)));

aka Rx= [Ry++] fails

However,making this simpler works:
rtx tmp_reg_rtx = copy_to_mode_reg (QImode,gen_rtx_MEM  (QImode, addr1));
emit_move_insn (addr1, gen_rtx_PLUS (Pmode, addr1, const1_rtx));
aka
Rx=[Ry]
Ry=Ry+1 For now I have gone back to the second case, though the code is not quite as good.

thanks again

Andy




Reply via email to