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: canonicalize_condition vs zero_extract


On 07/01/2010 05:17 AM, DJ Delorie wrote:
If you have an insn that does "test<const>,<reg>", gcc will look for
a pattern that uses zero_extract to generate the "condition" when
<const>  is a power of two.  However, canincalize_condition gets passed
this condition, and only expects the RTL at this point to have two
subexpressions.  Zero_extract has three, so it blows up:

return gen_rtx_fmt_ee (code, VOIDmode, op0, op1);

This is a simple check for this case, but is it the right solution?
Would it be better to:

* Check for a generic "this rtl has more than 2 xexp's"?

This is better done...


* Check for the codes we know, and return 0 for the rest?

... by simply checking for COMPARISON_P.


* Find out why a zero_extract is getting this far in the first place?

This also sounds like a good idea. Maybe a small testcase and a backtrace will be enough?


Paolo


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