This is the mail archive of the
mailing list for the GCC project.
Re: [PR19351, C++] Fix heap overflow in operator new
* Eric Botcazou:
>> The advantage of this approach is full ABI compatibility (in both
>> directions). The downside is slightly worse code (but it's still
>> branch-free; support for saturating arithmetic would probably improve things
> What do you mean by "branch-free" exactly? The code generates 2 COND_EXPRs.
Oops, sorry. "Branch-free on i386 and amd64, for the common case of
non-VLAs". The outer COND_EXPR and the division are removed by fold
because the object size is known at compile time.
(The VLA case is a GCC extension, likely totally unused in this
particular context, so I don't mind the really bad code which is
generated for that.)