tech-toolchain archive

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

Re: ABI issues with gcc



In article <20140124052002.GF6425%pony.stderr.spb.ru@localhost>,
Valery Ushakov  <uwe%stderr.spb.ru@localhost> wrote:
>On Thu, Jan 23, 2014 at 10:42:40 -0500, Christos Zoulas wrote:
>
>> In the process of getting gcc-4.8.x work with NetBSD we encountered an
>> issue with sh3, m68k, and vax (maybe more) where spurious SSP warnings
>> appear during compilation. I distilled this to a simple test which I have
>> submitted to the gcc folks 
>> (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59674)
>> 
>> Basically this boils down to us having an alignment requirement of an 8
>> byte boundary for long long and double, where having a STACK_BOUNDARY
>> in the ABI of 4. Gcc does not like that and it does not pre-compute
>> where those variables go when it first decides the stack layout of the
>> function and it allocates them dynamically in the next pass, leading
>> the SSP code to believe this function has a variable stack.
>> 
>> The choices here are:
>> 
>>      1. disable ssp for those platforms
>>      2. fix gcc so that it deals with this case (the gcc people will
>>         probably not take back the changes)
>>      3. fix our ABI so for those archs we have a STACK_BOUNDAY of 8
>
>Is it really the case for sh3?
>
>#define STACK_BOUNDARY  BIGGEST_ALIGNMENT
>#define BIGGEST_ALIGNMENT  (TARGET_ALIGN_DOUBLE ? 64 : 32)
>#define TARGET_ALIGN_DOUBLE ((target_flags & MASK_ALIGN_DOUBLE) != 0
>
>And the only occurence of MASK_ALIGN_DOUBLE is:
>
>  if (TARGET_SH5)
>    {
>      sh_cpu = PROCESSOR_SH5;
>      target_flags |= MASK_ALIGN_DOUBLE;

Does the test program in the gcc PR fail?

christos



Home | Main Index | Thread Index | Old Index