Re: strlen() and constant folding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thanks.  what about about the case i described below?

On Tue, Jun 30, 2009 at 11:46 AM, Andrew Haley<aph@xxxxxxxxxx> wrote:
> Bryan Christ wrote:
>> Interesting.  Is this documented somewhere?
>
> I doubt it.  Most optimizations aren't specially documented.
>
>> Is it reliable cross-platform?
>
> Yes.
>
>> What if...
>>
>> int poo(void)
>> {
>>    const char *test="test";
>>    const char *foo;
>>
>>    foo=test;
>>
>>    return strlen(foo);
>> }
>
> poo():
>        movl    $4, %eax
>        ret
>
> Andrew.
>
>



-- 
Bryan
<><


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux