This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] MALLOC_ABI_ALIGNMENT macro + malloc-alignment param
On Fri, Jul 18, 2008 at 6:21 PM, Olivier Hainque <hainque@adacore.com> wrote:
> Richard Guenther wrote:
>> I suggest to add a target macro that specifies the minimal alignment
>> a C conformant malloc implementation has to provide.
>
> Fine with me :)
>
> I had used MALLOC_ABI_ALIGNMENT as the name lately. Fine with you ?
Yes.
>> This would for example be 4 on i?86-linux (even though the glibc
>> implementation provides 8 I think) and 8 on x86_64-linux.
>
>> The default value for the target macro should be 1 for safety,
>> though eventually 4 for ilp32 and 8 for lp64 targets would do as
>> well.
>
> LONG_TYPE_SIZE ?
BITS_PER_WORD / 8 eventually. But I don't really know, there might
be strange ABIs around ;) It would at least be a start for the patch.
>> The malloc_align function attribute is a separate thing and you
>> don't need to bother about it.
>
> Understood,
>
>> I don't think we should have a --param to override the values.
>
> OK. I thought it was a nice idea, providing a convenient device
> at a very low implementation cost. No strong feeling though.
It might cause subtle bugreports, like this -falign-double does all the time
because it "breaks" the ABI ...
> Thanks much for your feedback,
>
> Olivier
>
>
>
>
>