[patch] Bug in arm_final_prescan_insn

Paul Brook paul@codesourcery.com
Wed Sep 7 14:10:00 GMT 2005


On Wednesday 07 September 2005 14:36, Paul Brook wrote:
> As the comment in the code says, arm_final_prescan_insn calls get_attr_*
> which may clobber recog_data. This needs to be restored before returning.
> To this it calls recog(). However AFAICS this doesn't have the desired
> effect. It just returns the pattern ID.
>
> The attached patch fixes this by using extract_constrain_insn_cached()
> instead. This is the same routine as used by get_attr_*.
>
> I haven't managed to come up with a testcase for this. It showed up with
> some local Thumb-2 changes which use this much more aggressively.

Specifically get_attr_* sets which_alternative but recog() does not, so the 
wrong alternative was being output.

Paul



More information about the Gcc-patches mailing list