This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimize strlen/strcmp/strncmp/strncpy/fputs on ?: or comma expressions
- From: Aaron Lehmann <aaronl at vitelus dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 23 Jun 2003 15:43:20 -0700
- Subject: Re: [PATCH] Optimize strlen/strcmp/strncmp/strncpy/fputs on ?: or comma expressions
- References: <20030623131916.GY20507@sunsite.ms.mff.cuni.cz>
On Mon, Jun 23, 2003 at 03:19:16PM +0200, Jakub Jelinek wrote:
> Hi!
>
> This is something I've noticed in Roger's sample code.
> j = strlen (i++ ? "foo" : "bar");
> can be optimized into
> i++; j = 3;
> and similarly other functions.
How many times does this optimization trigger during a bootstrap?
Does anybody actually write code like that?