This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Towards GNU11


On Thu, Oct 16, 2014 at 3:35 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Wed, Oct 15, 2014 at 3:08 AM, Marek Polacek <polacek@redhat.com> wrote:
>> On Tue, Oct 14, 2014 at 09:23:29AM +0200, Marek Polacek wrote:
>>> The consensus seems to be to go forward with this change.  I will
>>> commit the patch in 24 hours unless I hear objections.
>>
>> I made the change.  Please report any fallout to me.
>
> Yes the Linux kernel fails to compile for aarch64 after this change:
> In file included from include/linux/mutex.h:15:0,
>                  from include/linux/kvm_host.h:12,
>                  from arch/arm64/kvm/../../../virt/kvm/kvm_main.c:21:
> include/linux/spinlock_types.h:82:2: error: initializer element is not constant
>   (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname)
>   ^
> include/linux/spinlock_types.h:84:43: note: in expansion of macro
> â__SPIN_LOCK_UNLOCKEDâ
>  #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
>                                            ^
> arch/arm64/kvm/../../../virt/kvm/kvm_main.c:75:1: note: in expansion
> of macro âDEFINE_SPINLOCKâ
>  DEFINE_SPINLOCK(kvm_lock);
>  ^
> include/linux/spinlock_types.h:60:2: error: initializer element is not constant
>   (raw_spinlock_t) __RAW_SPIN_LOCK_INITIALIZER(lockname)
>   ^
> include/linux/spinlock_types.h:62:51: note: in expansion of macro
> â__RAW_SPIN_LOCK_UNLOCKEDâ
>  #define DEFINE_RAW_SPINLOCK(x) raw_spinlock_t x = __RAW_SPIN_LOCK_UNLOCKED(x)
>                                                    ^
> arch/arm64/kvm/../../../virt/kvm/kvm_main.c:76:8: note: in expansion
> of macro âDEFINE_RAW_SPINLOCKâ
>  static DEFINE_RAW_SPINLOCK(kvm_count_lock);
>         ^

Here is a short testcase which shows the behavior difference between
GNU89 and GNU11:
typedef struct {
 volatile unsigned int lock;
} arch_rwlock_t;
typedef struct {
 arch_rwlock_t raw_lock;
} rwlock_t;

static rwlock_t step_hook_lock = (rwlock_t) { .raw_lock = { 0 }, };


Thanks,
Andrew


>
>
>
>>
>> Enjoy.
>>
>>         Marek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]