This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][SH] Check for 0 length with inlined strnlen builtin
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: Christian Bruel <christian dot bruel at st dot com>
- Cc: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 07 Jan 2015 11:23:13 +0100
- Subject: Re: [PATCH][SH] Check for 0 length with inlined strnlen builtin
- Authentication-results: sourceware.org; auth=none
- References: <54ABAAD0 dot 4020302 at st dot com> <1420537273 dot 2473 dot 89 dot camel at yam-132-YW-E178-FTW> <54ABD16D dot 9000508 at st dot com>
On Tue, 2015-01-06 at 13:13 +0100, Christian Bruel wrote:
> > Please use 'gen_cmpeqsi_t (len, const0_rtx)' for comparing a value
> > against zero instead of the bit test insn.
>
> OK, also then OK to replace the other occurrences of the idiom for
> coding consistency ? (not sure if I could commit this as obvious ?).
In the end the same "tst reg,reg" instruction will be generated, but
with one reg operand instead of two. It might have some impact on the
register allocation in some cases. If it passes testing, it's OK I
think.
Cheers,
Oleg