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]

Re: loop-invariant.c patch: Use validate_change to avoid breaking match_dup


> This is another bug I came across while working on the ARM ldm/stm
> peephole patch.  In loop-invariant.c, we currently replace RTL directly
> without ensuring that this produces valid insns.  As a result, insn
> patterns that use match_dup to match inputs to outputs can get broken.

Not quite true, loop-invariant.c already calls validate_change in one case.

> Fixed by this patch, which uses validate_change instead of directly
> replacing things.  It's slightly convoluted (doing the changes twice) in
> order to avoid changing anything until the moment we know everything is OK.

Double validation for everyone because of a single pattern of a single target 
seems a somewhat high price to pay.  Can't the code be reorganized a little 
to avoid it?

-- 
Eric Botcazou


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