combine corrupts insns + dumps with insn cost problems
Eric Botcazou
ebotcazou@libertysurf.fr
Fri Jun 29 12:36:00 GMT 2007
> But try_combine() doesn't take that into account:
>
> /* If we had to change another insn, make sure it is valid also. */
> if (undobuf.other_insn)
> {
> rtx other_pat = PATTERN (undobuf.other_insn);
> ...
> other_code_number = recog_for_combine (&other_pat,
> undobuf.other_insn, &new_other_notes);
> ...
> PATTERN (undobuf.other_insn) = other_pat;
>
> This is not (necessarily) the same other_pat that we started with.
Right, that's why the code is written indirectly.
> Index: gcc/combine.c
> ===================================================================
> --- gcc/combine.c (revision 125984)
> +++ gcc/combine.c (working copy)
> @@ -3298,7 +3298,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int
> return 0;
> }
>
> - PATTERN (undobuf.other_insn) = other_pat;
> + SUBST (PATTERN (undobuf.other_insn), other_pat);
I'm not too thrilled by this. I think that the above code is meant to be the
last verification before committing the change, but is not (anymore?) since
there are 2 calls to undo_all right after it.
Would it solve your problem to move the block of code after the 2 calls?
--
Eric Botcazou
More information about the Gcc
mailing list