> -----Original Message-----
> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-
> ow...@gcc.gnu.org] On Behalf Of Richard Henderson
> Sent: Monday, November 24, 2014 4:57 PM
> To: Zhenqiang Chen; gcc-patches@gcc.gnu.org
> Cc: Marcus Shawcroft
> Subject: Re: [PATCH, AARCH64] Fix ICE in CCMP (PR64015)
> 
> On 11/24/2014 06:11 AM, Zhenqiang Chen wrote:
> > Expand pass always uses sign-extend to represent constant value. For
> > the case in the patch, a 8-bit unsigned value "252" is represented as
> > "-4", which pass the ccmn check. After mode conversion, "-4" becomes
> > "252", which leads to mismatch.
> 
> This sort of thing is why I suggested from the beginning that expansion
> happen directly from trees instead of sort-of re-expanding from rtl.
> 
> I think you're better off fixing this properly than hacking around it here.

Thanks for the comments.

Here was your previous comments: "We could avoid that by using struct 
expand_operand, create_input_operand et al, then expand_insn.  That does 
require that the target hooks be given trees rather than rtl as input."

I want to confirm with you two things before I rework it.
(1) expand_insn needs an optab_handler as input. Do I need to define a 
ccmp_optab with different mode support in optabs.def?
(2) To make sure later operands not clobber CC, all operands are expanded 
before ccmp-first in current implementation. If taking tree/gimple as input, 
what's your preferred logic to guarantee CC not clobbered?

Thanks!
-Zhenqiang



Reply via email to