Re: [PATCH 0/1] vsprintf: optimize decimal conversion (again)

From: Denys Vlasenko
Date: Thu Mar 29 2012 - 06:35:45 EST


On Wed, Mar 28, 2012 at 12:33 PM, Denys Vlasenko
<vda.linux@xxxxxxxxxxxxxx> wrote:
> On Wednesday 28 March 2012 12:24, roma1390 wrote:
>> On 2012.03.28 13:13, Denys Vlasenko wrote:
>> > Second: run
>> > arm-linux-gnueabi-gcc -O2 -Wall test_{org,new}.c -S
>> > and email me resulting test_{org,new}.s files.
>>
>> test_{org,new}.s attached.
>
> Bingo.
>
>        bl      __aeabi_uidivmod
>
> Not good. Your gcc did not optimize division by constant.
>
> Can you add  "noinline_for_stack":
>
> static noinline_for_stack <=== HERE
> char *put_dec(char *buf, unsigned long long n)
>
> and regenerate and resend the test_new.s?

Since you confirmed that noinlining helps,
I recommend you to file a gcc bug report:
your gcc misses an optimization when it inlines
that function.

--
vda
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/