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] Handle read-only vars initialized to string literals in c_strlen (take 2)


On Tue, Sep 14, 2004 at 11:31:08AM -0400, Jakub Jelinek wrote:
> +  /* This will result in strlen call, because larger
> +     array is bigger than its initializer.  */

Hmm?  Why?  If the array is _larger_ than its initializer, then
you know that the subsequent values are zero.

The test you want is for _short_ arrays *not* being converted.
To do that you will have to check the array by name inside the
strlen replacement, since we know for a fact there is no null.


r~


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