This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] replace a bunch of equivalent checks for asm operands with a new function
- From: Steven Bosscher <stevenb dot gcc at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 Apr 2013 21:22:20 +0200
- Subject: Re: [patch] replace a bunch of equivalent checks for asm operands with a new function
- References: <CABu31nPOq_39_=LPL8U8vpu7mZivAJ8DDoM_a-k6yHn+jO=Ycw at mail dot gmail dot com> <2614188 dot qgNTnJTDhJ at polaris>
On Tue, Apr 2, 2013 at 12:34 PM, Eric Botcazou wrote:
>> This idiom: "if (GET_CODE (body) == ASM_INPUT || asm_noperands (body)
>>
>> >= 0)" appears in multiple places. There's even one place where the
>>
>> idiom above is used in reverse (making the GET_CODE... check
>> redundant). A few more places to the equivalent by checking
>> extract_asm_operands != NULL.
>
> I think that the last point is not clear: asm_noperands can return -1 and yet
> extract_asm_operands has returned non-NULL.
Hmm, what do you have in mind for such a situation?
If extract_asm_operands returns NULL then asm_noperands will return -1.
If extract_asm_operands returns non-NULL then asm_noperands deep-dives
the PATTERN of the insn (just like extract_asm_operands) and returns
>= 0 unless the insn is invalid.
Also, lots of places check only asm_noperands to see if an insn is an
asm, see cse.c, reload1.c, cprop.c, etc.
Am I missing something?
Ciao!
Steven