This is the mail archive of the
mailing list for the GCC project.
Re: [patch] replace a bunch of equivalent checks for asm operands with a new function
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 02 Apr 2013 12:34:02 +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>
> 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. And, at least in some cases, I
think that the right predicate is extract_asm_operands. In fact, I wonder
whether in most cases the right combined predicate would be:
GET_CODE (body) == ASM_INPUT || extract_asm_operands (body) != NULL
and asm_noperands only used when you really care about the operands.
> It made sense to me, at least, to replace those equivalent checks with
> a new function: insn_with_asm_operands_p().
The first hunk for config/ia64/ia64.c looks incorrect.