This is the mail archive of the
mailing list for the GCC project.
Re: canonicalize_condition vs zero_extract
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 01 Jul 2010 10:06:48 +0200
- Subject: Re: canonicalize_condition vs zero_extract
- References: <201007010317.o613HmhD016051@greed.delorie.com>
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?