Mitigation for PR target/88469 on arm-based systems bootstrapping with gcc-6/7/8

Richard Earnshaw (lists) Richard.Earnshaw@arm.com
Wed Jan 23 09:35:00 GMT 2019


On 22/01/2019 15:46, Jakub Jelinek wrote:
> On Tue, Jan 22, 2019 at 02:43:38PM +0000, Richard Earnshaw (lists) wrote:
>> 	PR target/88469
>> 	* profile-count.h (profile_count): Add dummy file with 64-bit alignment
>> 	on arm-based systems using gcc-6/7/8.
>>
> 
>> diff --git a/gcc/profile-count.h b/gcc/profile-count.h
>> index c83fa3beb8f..ddfda2cddf4 100644
>> --- a/gcc/profile-count.h
>> +++ b/gcc/profile-count.h
>> @@ -645,6 +645,12 @@ private:
>>  
>>    uint64_t m_val : n_bits;
>>    enum profile_quality m_quality : 3;
>> +#if defined (__arm__) && (__GNUC__ >= 6 && __GNUC__ <= 8)
>> +  /* Work-around for PR88469.  A bug in the gcc-6/7/8 PCS layout code
>> +     incorrectly detects the alignment of a structure where the only
>> +     64-bit aligned element is a bit-field.  */
>> +  uint64_t m_force_alignment;
>> +#endif
> 
> Adding another member is very costly.
> Can't you do something like:
> #if defined (__arm__) && (__GNUC__ >= 6 && __GNUC__ <= 8)
> #define UINT64_BITFIELD_ALIGN \
>   __attribute__((__aligned__ (__alignof__ (uint64_t))))
> #else
> #define UINT64_BITFIELD_ALIGN
> #endif
> and use
>   uint64_t m_val UINT64_BITFIELD_ALIGN : n_bits;
> ?
> 
> 	Jakub
> 

Close.  The alignment has to come before the m_val...


PR target/88469
 	* profile-count.h (profile_count): Force alignment of
	m_val when building on Arm-based systems with gcc-6/7/8.

OK for trunk/gcc-8?

R.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: profile_count.patch
Type: text/x-patch
Size: 1020 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190123/b67b82ac/attachment.bin>


More information about the Gcc-patches mailing list