PATCH: reduce strlen() calls
Devang Patel
dpatel@apple.com
Fri Jul 26 14:07:00 GMT 2002
On Friday, July 26, 2002, at 01:39 PM, Geoff Keating wrote:
>> I think, that's what `write_string` macro is doing. But if a string
>> size is
>> fixed, why run strlen() to measure it?
>
> GCC is supposed to evaluate strlen() of a constant string at compile
> time, so it doesn't actually get called anyway.
Oh, OK. I did not know about it.
Where can I find code to do this in gcc sources?
So, it only effects compiler bootstrap. On the other side, we are the
ones who pay cost of bootstrap time.
Apart from this, is there any reason not to use fixed size number
for fixed strings? May be I am missing something obvious?
Thank you,
-Devang
More information about the Gcc-patches
mailing list