This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Optimize strlen/strcmp/strncmp/strncpy/fputs on ?: or comma expressions


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]