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

Reply via email to