This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: canonical condition branch
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Mike Stump <mikestump at comcast dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 3 Oct 2010 11:29:57 +0200
- Subject: Re: canonical condition branch
- References: <93FB9EB0-77DA-4DF2-B25F-2CE73CE30D8E@comcast.net>
> I used that pattern as that is what I saw combine looking for and failing
> to find... but, in rtlanal.c (canonicalize_condition), we have:
>
> Index: gcc/gcc/rtlanal.c
> ===================================================================
> --- gcc/gcc/rtlanal.c (revision 850)
> +++ gcc/gcc/rtlanal.c (working copy)
> @@ -4933,6 +4933,9 @@
> if (CC0_P (op0))
> return 0;
>
> + if (GET_RTX_LENGTH (code) != 2)
> + return 0;
> +
> return gen_rtx_fmt_ee (code, VOIDmode, op0, op1);
> }
>
> which drops op2 because zero_extract is a 3 operand code, not a 2 operand
> code. So, then question is, should we add the above patch to avoid
> building bad rtl code?
I think other places could expect the first operand of if_then_else to be a
condition. You should try and rewrite the pattern to make it use a condition
operator, see *jcc_bt in the i386 port for example.
--
Eric Botcazou