master: Build failure in malloc with GCC 7
Florian Weimer
fweimer@redhat.com
Wed Jul 12 12:58:00 GMT 2017
On 07/12/2017 02:29 PM, Andreas Schwab wrote:
> On Jul 12 2017, Florian Weimer <fweimer@redhat.com> wrote:
>
>> The attached patch adds an assert which reveals to the GCC optimizers
>> that the global_max_fast can never MAX_FAST_SIZE, so this particular
>> issue goes away. However, there is a cost in terms of code size because
>> it affects many places in malloc.
>
> Can __builtin_unreachable avoid the runtime overhead?
Interesting idea. I have never used __builtin_unreachable before, I think.
Current master:
text data bss dec hex filename
64592 2392 104 67088 10610 /root/build/malloc/malloc.o
My second patch:
text data bss dec hex filename
64424 2392 104 66920 10568 /root/build/malloc/malloc.o
Attached patch:
text data bss dec hex filename
64504 2392 104 67000 105b8 /root/build/malloc/malloc.o
Looking at the GIMPLE dumps, the code is somewhat improved over my
second patch.
Thanks,
Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: malloc-assert-3.patch
Type: text/x-patch
Size: 1543 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170712/e7c42117/attachment.bin>
More information about the Libc-alpha
mailing list