This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Towards GNU11
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, GCC <gcc at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Jeff Law <law at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, Jason Merrill <jason at redhat dot com>, Richard Biener <rguenther at suse dot de>
- Date: Thu, 16 Oct 2014 15:38:43 -0700
- Subject: Re: Towards GNU11
- Authentication-results: sourceware.org; auth=none
- References: <20141007210756 dot GA1002 at redhat dot com> <20141014072328 dot GS1002 at redhat dot com> <20141015100852 dot GV1002 at redhat dot com> <CA+=Sn1=ZDBY2UbFg9Vj0B2Qx+SUzA5=oVb7ZyacPfXE1O5T4zw at mail dot gmail dot com>
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