public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* h8300 build failures ijn linux-next
@ 2015-08-24 18:34 Guenter Roeck
  2015-08-25  5:56 ` Yoshinori Sato
  0 siblings, 1 reply; 13+ messages in thread
From: Guenter Roeck @ 2015-08-24 18:34 UTC (permalink / raw)
  To: Yoshinori Sato; +Cc: uclinux-h8-devel, linux-kernel@vger.kernel.org

Hi,

In linux-next as of today (0824), all h8300 builds fail for me with an internal
compiler error.

Building h8300:allnoconfig ... failed
--------------
Error log:

In file included from include/linux/rcupdate.h:429:0,
                  from include/linux/rcusync.h:5,
                  from kernel/rcu/sync.c:1:
include/linux/rcutiny.h: In function ‘rcu_barrier_sched’:
include/linux/rcutiny.h:55:20: internal compiler error: Segmentation fault
  static inline void rcu_barrier_sched(void)
                     ^

I tried both gcc 5.1 and 5.2, built with the patch set available to me.

Is there a more recent compiler / patch set available that might fix the problem ?

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: h8300 build failures ijn linux-next
  2015-08-24 18:34 h8300 build failures ijn linux-next Guenter Roeck
@ 2015-08-25  5:56 ` Yoshinori Sato
  2015-08-25 14:27   ` Mark Salter
  0 siblings, 1 reply; 13+ messages in thread
From: Yoshinori Sato @ 2015-08-25  5:56 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: uclinux-h8-devel, linux-kernel@vger.kernel.org

On Tue, 25 Aug 2015 03:34:20 +0900,
Guenter Roeck wrote:
> 
> Hi,
> 
> In linux-next as of today (0824), all h8300 builds fail for me with an internal
> compiler error.
> 
> Building h8300:allnoconfig ... failed
> --------------
> Error log:
> 
> In file included from include/linux/rcupdate.h:429:0,
>                  from include/linux/rcusync.h:5,
>                  from kernel/rcu/sync.c:1:
> include/linux/rcutiny.h: In function ‘rcu_barrier_sched’:
> include/linux/rcutiny.h:55:20: internal compiler error: Segmentation fault
>  static inline void rcu_barrier_sched(void)
>                     ^
> 
> I tried both gcc 5.1 and 5.2, built with the patch set available to me.
> 
> Is there a more recent compiler / patch set available that might fix the problem ?
> 

No.
I tried gcc 6.0. It got same error.
It looks optimization problem on h8300 target.
I will investigate it.

> Thanks,
> Guenter

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: h8300 build failures ijn linux-next
  2015-08-25  5:56 ` Yoshinori Sato
@ 2015-08-25 14:27   ` Mark Salter
  2015-08-25 15:03     ` h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300) Guenter Roeck
  0 siblings, 1 reply; 13+ messages in thread
From: Mark Salter @ 2015-08-25 14:27 UTC (permalink / raw)
  To: Yoshinori Sato, Guenter Roeck
  Cc: uclinux-h8-devel, linux-kernel@vger.kernel.org

On Tue, 2015-08-25 at 14:56 +0900, Yoshinori Sato wrote:
> On Tue, 25 Aug 2015 03:34:20 +0900,
> Guenter Roeck wrote:
> > 
> > Hi,
> > 
> > In linux-next as of today (0824), all h8300 builds fail for me with an 
> > internal
> > compiler error.
> > 
> > Building h8300:allnoconfig ... failed
> > --------------
> > Error log:
> > 
> > In file included from include/linux/rcupdate.h:429:0,
> >                  from include/linux/rcusync.h:5,
> >                  from kernel/rcu/sync.c:1:
> > include/linux/rcutiny.h: In function ‘rcu_barrier_sched’:
> > include/linux/rcutiny.h:55:20: internal compiler error: Segmentation 
> > fault
> >  static inline void rcu_barrier_sched(void)
> >                     ^
> > 
> > I tried both gcc 5.1 and 5.2, built with the patch set available to me.
> > 
> > Is there a more recent compiler / patch set available that might fix 
> > the problem ?
> > 
> 
> No.
> I tried gcc 6.0. It got same error.
> It looks optimization problem on h8300 target.
> I will investigate it.

I get the same ICE with c6x gcc 5.1

> > Thanks,
> > Guenter
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300)
  2015-08-25 14:27   ` Mark Salter
@ 2015-08-25 15:03     ` Guenter Roeck
  2015-08-25 16:11       ` Oleg Nesterov
                         ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Guenter Roeck @ 2015-08-25 15:03 UTC (permalink / raw)
  To: Mark Salter, Yoshinori Sato
  Cc: uclinux-h8-devel, linux-kernel@vger.kernel.org, Oleg Nesterov,
	Peter Zijlstra (Intel), Paul E. McKenney, Josh Triplett

Hi Mark,

On 08/25/2015 07:27 AM, Mark Salter wrote:
> On Tue, 2015-08-25 at 14:56 +0900, Yoshinori Sato wrote:
>> On Tue, 25 Aug 2015 03:34:20 +0900,
>> Guenter Roeck wrote:
>>>
>>> Hi,
>>>
>>> In linux-next as of today (0824), all h8300 builds fail for me with an
>>> internal
>>> compiler error.
>>>
>>> Building h8300:allnoconfig ... failed
>>> --------------
>>> Error log:
>>>
>>> In file included from include/linux/rcupdate.h:429:0,
>>>                   from include/linux/rcusync.h:5,
>>>                   from kernel/rcu/sync.c:1:
>>> include/linux/rcutiny.h: In function ‘rcu_barrier_sched’:
>>> include/linux/rcutiny.h:55:20: internal compiler error: Segmentation
>>> fault
>>>   static inline void rcu_barrier_sched(void)
>>>                      ^
>>>
>>> I tried both gcc 5.1 and 5.2, built with the patch set available to me.
>>>
>>> Is there a more recent compiler / patch set available that might fix
>>> the problem ?
>>>
>>
>> No.
>> I tried gcc 6.0. It got same error.
>> It looks optimization problem on h8300 target.
>> I will investigate it.
>
> I get the same ICE with c6x gcc 5.1
>

Interesting. h8300 was the only gcc 5+ compiler I had used so far.
Just for fun, I built an alpha toolchain with gcc 5.1. Same problem there.
So it looks like it isn't a h8300 problem after all, it is a gcc problem.

Updated subject line, and copied rcu maintainers.

Guenter


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300)
  2015-08-25 15:03     ` h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300) Guenter Roeck
@ 2015-08-25 16:11       ` Oleg Nesterov
  2015-08-25 16:23         ` Oleg Nesterov
  2015-08-25 16:51       ` Yoshinori Sato
  2015-08-25 18:45       ` [PATCH] rcu: change _wait_rcu_gp() to work around gcc 67055 bug Oleg Nesterov
  2 siblings, 1 reply; 13+ messages in thread
From: Oleg Nesterov @ 2015-08-25 16:11 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Mark Salter, Yoshinori Sato, uclinux-h8-devel,
	linux-kernel@vger.kernel.org, Peter Zijlstra (Intel),
	Paul E. McKenney, Josh Triplett

On 08/25, Guenter Roeck wrote:
>
> Hi Mark,
>
> On 08/25/2015 07:27 AM, Mark Salter wrote:
>> On Tue, 2015-08-25 at 14:56 +0900, Yoshinori Sato wrote:
>>> On Tue, 25 Aug 2015 03:34:20 +0900,
>>> Guenter Roeck wrote:
>>>>
>>>> Hi,
>>>>
>>>> In linux-next as of today (0824), all h8300 builds fail for me with an
>>>> internal
>>>> compiler error.
>>>>
>>>> Building h8300:allnoconfig ... failed
>>>> --------------
>>>> Error log:
>>>>
>>>> In file included from include/linux/rcupdate.h:429:0,
>>>>                   from include/linux/rcusync.h:5,
>>>>                   from kernel/rcu/sync.c:1:
>>>> include/linux/rcutiny.h: In function ‘rcu_barrier_sched’:
>>>> include/linux/rcutiny.h:55:20: internal compiler error: Segmentation
>>>> fault
>>>>   static inline void rcu_barrier_sched(void)
>>>>                      ^
>>>>
>>>> I tried both gcc 5.1 and 5.2, built with the patch set available to me.
>>>>
>>>> Is there a more recent compiler / patch set available that might fix
>>>> the problem ?
>>>>
>>>
>>> No.
>>> I tried gcc 6.0. It got same error.
>>> It looks optimization problem on h8300 target.
>>> I will investigate it.
>>
>> I get the same ICE with c6x gcc 5.1
>>
>
> Interesting. h8300 was the only gcc 5+ compiler I had used so far.
> Just for fun, I built an alpha toolchain with gcc 5.1. Same problem there.
> So it looks like it isn't a h8300 problem after all, it is a gcc problem.
>
> Updated subject line, and copied rcu maintainers.

Damn. This was caused by my patch, I need to react, and I do not know
what to say ;)

OK, this is gcc bug. But we probably need the workaround, and I don't
have a h8300 machine so I can't test the fix.

Could you please try to compile kernel/rcu/sync.o with the patch below?
Just to know how "stable" this bug is. I expect the compilation should
fail again, rcutiny.h:rcu_barrier() is "inline" too.

Oleg.


--- a/kernel/rcu/sync.c
+++ b/kernel/rcu/sync.c
@@ -24,7 +24,6 @@ static const struct {
 	[RCU_SCHED_SYNC] = {
 		.sync = synchronize_sched,
 		.call = call_rcu_sched,
-		.wait = rcu_barrier_sched,
 		__INIT_HELD(rcu_read_lock_sched_held)
 	},
 	[RCU_BH_SYNC] = {


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300)
  2015-08-25 16:11       ` Oleg Nesterov
@ 2015-08-25 16:23         ` Oleg Nesterov
  0 siblings, 0 replies; 13+ messages in thread
From: Oleg Nesterov @ 2015-08-25 16:23 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Mark Salter, Yoshinori Sato, uclinux-h8-devel,
	linux-kernel@vger.kernel.org, Peter Zijlstra (Intel),
	Paul E. McKenney, Josh Triplett

On 08/25, Oleg Nesterov wrote:
>
> OK, this is gcc bug. But we probably need the workaround, and I don't
> have a h8300 machine so I can't test the fix.
>
> Could you please try to compile kernel/rcu/sync.o with the patch below?
> Just to know how "stable" this bug is. I expect the compilation should
> fail again, rcutiny.h:rcu_barrier() is "inline" too.

Wait, I reproduced the same problem on x86. Thanks.

Oleg.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300)
  2015-08-25 15:03     ` h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300) Guenter Roeck
  2015-08-25 16:11       ` Oleg Nesterov
@ 2015-08-25 16:51       ` Yoshinori Sato
  2015-08-25 17:34         ` Oleg Nesterov
  2015-08-25 18:45       ` [PATCH] rcu: change _wait_rcu_gp() to work around gcc 67055 bug Oleg Nesterov
  2 siblings, 1 reply; 13+ messages in thread
From: Yoshinori Sato @ 2015-08-25 16:51 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Mark Salter, uclinux-h8-devel, linux-kernel@vger.kernel.org,
	Oleg Nesterov, Peter Zijlstra (Intel), Paul E. McKenney,
	Josh Triplett

On Wed, 26 Aug 2015 00:03:35 +0900,
Guenter Roeck wrote:
> 
> Hi Mark,
> 
> On 08/25/2015 07:27 AM, Mark Salter wrote:
> > On Tue, 2015-08-25 at 14:56 +0900, Yoshinori Sato wrote:
> >> On Tue, 25 Aug 2015 03:34:20 +0900,
> >> Guenter Roeck wrote:
> >>> 
> >>> Hi,
> >>> 
> >>> In linux-next as of today (0824), all h8300 builds fail for me with an
> >>> internal
> >>> compiler error.
> >>> 
> >>> Building h8300:allnoconfig ... failed
> >>> --------------
> >>> Error log:
> >>> 
> >>> In file included from include/linux/rcupdate.h:429:0,
> >>>                   from include/linux/rcusync.h:5,
> >>>                   from kernel/rcu/sync.c:1:
> >>> include/linux/rcutiny.h: In function ‘rcu_barrier_sched’:
> >>> include/linux/rcutiny.h:55:20: internal compiler error: Segmentation
> >>> fault
> >>>   static inline void rcu_barrier_sched(void)
> >>>                      ^
> >>> 
> >>> I tried both gcc 5.1 and 5.2, built with the patch set available to me.
> >>> 
> >>> Is there a more recent compiler / patch set available that might fix
> >>> the problem ?
> >>> 
> >> 
> >> No.
> >> I tried gcc 6.0. It got same error.
> >> It looks optimization problem on h8300 target.
> >> I will investigate it.
> > 
> > I get the same ICE with c6x gcc 5.1
> > 
> 
> Interesting. h8300 was the only gcc 5+ compiler I had used so far.
> Just for fun, I built an alpha toolchain with gcc 5.1. Same problem there.
> So it looks like it isn't a h8300 problem after all, it is a gcc problem.
> 
> Updated subject line, and copied rcu maintainers.
> 
> Guenter
> 

Yes.
gcc bug #67055.
Already fixed in trunk.

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300)
  2015-08-25 16:51       ` Yoshinori Sato
@ 2015-08-25 17:34         ` Oleg Nesterov
  2015-08-25 18:02           ` Oleg Nesterov
  0 siblings, 1 reply; 13+ messages in thread
From: Oleg Nesterov @ 2015-08-25 17:34 UTC (permalink / raw)
  To: Yoshinori Sato
  Cc: Guenter Roeck, Mark Salter, uclinux-h8-devel,
	linux-kernel@vger.kernel.org, Peter Zijlstra (Intel),
	Paul E. McKenney, Josh Triplett

On 08/26, Yoshinori Sato wrote:
>
> Yes.
> gcc bug #67055.
> Already fixed in trunk.

Yes, thanks a lot.

Paul, it seems that gcc actually dislikes your ec90a194a "rcu:
Create a synchronize_rcu_mult()" commit ;) rcu/sync.c was just
lucky enough to trigger the problem.

I'll try to make the fix today...

Oleg.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300)
  2015-08-25 17:34         ` Oleg Nesterov
@ 2015-08-25 18:02           ` Oleg Nesterov
  2015-08-25 18:16             ` Mark Salter
  0 siblings, 1 reply; 13+ messages in thread
From: Oleg Nesterov @ 2015-08-25 18:02 UTC (permalink / raw)
  To: Yoshinori Sato
  Cc: Guenter Roeck, Mark Salter, uclinux-h8-devel,
	linux-kernel@vger.kernel.org, Peter Zijlstra (Intel),
	Paul E. McKenney, Josh Triplett

On 08/25, Oleg Nesterov wrote:
>
> On 08/26, Yoshinori Sato wrote:
> >
> > Yes.
> > gcc bug #67055.
> > Already fixed in trunk.
>
> Yes, thanks a lot.
>
> Paul, it seems that gcc actually dislikes your ec90a194a "rcu:
> Create a synchronize_rcu_mult()" commit ;) rcu/sync.c was just
> lucky enough to trigger the problem.
>
> I'll try to make the fix today...

Mark, Guenter, any chance you can check if the patch below helps?
It does on x86.

Oleg.

--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -230,12 +230,11 @@ void __wait_rcu_gp(bool checktiny, int n, call_rcu_func_t *crcu_array,
 		   struct rcu_synchronize *rs_array);
 
 #define _wait_rcu_gp(checktiny, ...) \
-do { \
-	call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; \
-	const int __n = ARRAY_SIZE(__crcu_array); \
-	struct rcu_synchronize __rs_array[__n]; \
-	\
-	__wait_rcu_gp(checktiny, __n, __crcu_array, __rs_array); \
+do {									\
+	call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; 		\
+	struct rcu_synchronize __rs_array[ARRAY_SIZE(__crcu_array)];	\
+	__wait_rcu_gp(checktiny, ARRAY_SIZE(__crcu_array),		\
+			__crcu_array, __rs_array); 			\
 } while (0)
 
 #define wait_rcu_gp(...) _wait_rcu_gp(false, __VA_ARGS__)


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300)
  2015-08-25 18:02           ` Oleg Nesterov
@ 2015-08-25 18:16             ` Mark Salter
  0 siblings, 0 replies; 13+ messages in thread
From: Mark Salter @ 2015-08-25 18:16 UTC (permalink / raw)
  To: Oleg Nesterov, Yoshinori Sato
  Cc: Guenter Roeck, uclinux-h8-devel, linux-kernel@vger.kernel.org,
	Peter Zijlstra (Intel), Paul E. McKenney, Josh Triplett

On Tue, 2015-08-25 at 20:02 +0200, Oleg Nesterov wrote:
> On 08/25, Oleg Nesterov wrote:
> > 
> > On 08/26, Yoshinori Sato wrote:
> > > 
> > > Yes.
> > > gcc bug #67055.
> > > Already fixed in trunk.
> > 
> > Yes, thanks a lot.
> > 
> > Paul, it seems that gcc actually dislikes your ec90a194a "rcu:
> > Create a synchronize_rcu_mult()" commit ;) rcu/sync.c was just
> > lucky enough to trigger the problem.
> > 
> > I'll try to make the fix today...
> 
> Mark, Guenter, any chance you can check if the patch below helps?
> It does on x86.

Works for c6x.

> 
> Oleg.
> 
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -230,12 +230,11 @@ void __wait_rcu_gp(bool checktiny, int n, 
> call_rcu_func_t *crcu_array,
>  		   struct rcu_synchronize *rs_array);
>  
>  #define _wait_rcu_gp(checktiny, ...) \
> -do { \
> -	call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; \
> -	const int __n = ARRAY_SIZE(__crcu_array); \
> -	struct rcu_synchronize __rs_array[__n]; \
> -	\
> -	__wait_rcu_gp(checktiny, __n, __crcu_array, __rs_array); \
> +do {									
> \
> +	call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; 		
> \
> +	struct rcu_synchronize __rs_array[ARRAY_SIZE(__crcu_array)];	
> \
> +	__wait_rcu_gp(checktiny, ARRAY_SIZE(__crcu_array),		
> \
> +			__crcu_array, __rs_array); 			
> \
>  } while (0)
>  
>  #define wait_rcu_gp(...) _wait_rcu_gp(false, __VA_ARGS__)
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] rcu: change _wait_rcu_gp() to work around gcc 67055 bug
  2015-08-25 15:03     ` h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300) Guenter Roeck
  2015-08-25 16:11       ` Oleg Nesterov
  2015-08-25 16:51       ` Yoshinori Sato
@ 2015-08-25 18:45       ` Oleg Nesterov
  2015-08-25 19:00         ` Paul E. McKenney
  2015-08-25 19:02         ` Oleg Nesterov
  2 siblings, 2 replies; 13+ messages in thread
From: Oleg Nesterov @ 2015-08-25 18:45 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Mark Salter, Yoshinori Sato, uclinux-h8-devel,
	linux-kernel@vger.kernel.org, Peter Zijlstra (Intel),
	Josh Triplett, Guenter Roeck

The code like

	const int n = const-expr;
	whatever_t array[n];

in inline function can confuse gcc, see

	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67055#c13

This leads to

	In file included from include/linux/rcupdate.h:429:0,
			  from include/linux/rcusync.h:5,
			  from kernel/rcu/sync.c:1:
	include/linux/rcutiny.h: In function 'rcu_barrier_sched':
	include/linux/rcutiny.h:55:20: internal compiler error: Segmentation
	fault
	  static inline void rcu_barrier_sched(void)

build failure after ec90a194a "rcu: Create a synchronize_rcu_mult()"
and 114b7fd4b "rcu: Create rcu_sync infrastructure" meet each other.

Reported-and-tested-by: Mark Salter <msalter@redhat.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 include/linux/rcupdate.h | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index ff47651..c353c2b 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -230,12 +230,11 @@ void __wait_rcu_gp(bool checktiny, int n, call_rcu_func_t *crcu_array,
 		   struct rcu_synchronize *rs_array);
 
 #define _wait_rcu_gp(checktiny, ...) \
-do { \
-	call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; \
-	const int __n = ARRAY_SIZE(__crcu_array); \
-	struct rcu_synchronize __rs_array[__n]; \
-	\
-	__wait_rcu_gp(checktiny, __n, __crcu_array, __rs_array); \
+do {									\
+	call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; 		\
+	struct rcu_synchronize __rs_array[ARRAY_SIZE(__crcu_array)];	\
+	__wait_rcu_gp(checktiny, ARRAY_SIZE(__crcu_array),		\
+			__crcu_array, __rs_array); 			\
 } while (0)
 
 #define wait_rcu_gp(...) _wait_rcu_gp(false, __VA_ARGS__)
-- 
2.4.3



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] rcu: change _wait_rcu_gp() to work around gcc 67055 bug
  2015-08-25 18:45       ` [PATCH] rcu: change _wait_rcu_gp() to work around gcc 67055 bug Oleg Nesterov
@ 2015-08-25 19:00         ` Paul E. McKenney
  2015-08-25 19:02         ` Oleg Nesterov
  1 sibling, 0 replies; 13+ messages in thread
From: Paul E. McKenney @ 2015-08-25 19:00 UTC (permalink / raw)
  To: Oleg Nesterov
  Cc: Mark Salter, Yoshinori Sato, uclinux-h8-devel,
	linux-kernel@vger.kernel.org, Peter Zijlstra (Intel),
	Josh Triplett, Guenter Roeck

On Tue, Aug 25, 2015 at 08:45:18PM +0200, Oleg Nesterov wrote:
> The code like
> 
> 	const int n = const-expr;
> 	whatever_t array[n];
> 
> in inline function can confuse gcc, see
> 
> 	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67055#c13
> 
> This leads to
> 
> 	In file included from include/linux/rcupdate.h:429:0,
> 			  from include/linux/rcusync.h:5,
> 			  from kernel/rcu/sync.c:1:
> 	include/linux/rcutiny.h: In function 'rcu_barrier_sched':
> 	include/linux/rcutiny.h:55:20: internal compiler error: Segmentation
> 	fault
> 	  static inline void rcu_barrier_sched(void)
> 
> build failure after ec90a194a "rcu: Create a synchronize_rcu_mult()"
> and 114b7fd4b "rcu: Create rcu_sync infrastructure" meet each other.
> 
> Reported-and-tested-by: Mark Salter <msalter@redhat.com>
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>

Ouch!!!  Queued for testing, in the absence of problems, will push into
the upcoming merge window.

Thank you all for the testing and the fix!

							Thanx, Paul

> ---
>  include/linux/rcupdate.h | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index ff47651..c353c2b 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -230,12 +230,11 @@ void __wait_rcu_gp(bool checktiny, int n, call_rcu_func_t *crcu_array,
>  		   struct rcu_synchronize *rs_array);
> 
>  #define _wait_rcu_gp(checktiny, ...) \
> -do { \
> -	call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; \
> -	const int __n = ARRAY_SIZE(__crcu_array); \
> -	struct rcu_synchronize __rs_array[__n]; \
> -	\
> -	__wait_rcu_gp(checktiny, __n, __crcu_array, __rs_array); \
> +do {									\
> +	call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; 		\
> +	struct rcu_synchronize __rs_array[ARRAY_SIZE(__crcu_array)];	\
> +	__wait_rcu_gp(checktiny, ARRAY_SIZE(__crcu_array),		\
> +			__crcu_array, __rs_array); 			\
>  } while (0)
> 
>  #define wait_rcu_gp(...) _wait_rcu_gp(false, __VA_ARGS__)
> -- 
> 2.4.3
> 
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] rcu: change _wait_rcu_gp() to work around gcc 67055 bug
  2015-08-25 18:45       ` [PATCH] rcu: change _wait_rcu_gp() to work around gcc 67055 bug Oleg Nesterov
  2015-08-25 19:00         ` Paul E. McKenney
@ 2015-08-25 19:02         ` Oleg Nesterov
  1 sibling, 0 replies; 13+ messages in thread
From: Oleg Nesterov @ 2015-08-25 19:02 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Mark Salter, Yoshinori Sato, uclinux-h8-devel,
	linux-kernel@vger.kernel.org, Peter Zijlstra (Intel),
	Josh Triplett, Guenter Roeck

On 08/25, Oleg Nesterov wrote:
>
> The code like
> 
> 	const int n = const-expr;
> 	whatever_t array[n];
> 
> in inline function can confuse gcc, see
> 
> 	https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67055#c13
> 
> This leads to
> 
> 	In file included from include/linux/rcupdate.h:429:0,
> 			  from include/linux/rcusync.h:5,
> 			  from kernel/rcu/sync.c:1:
> 	include/linux/rcutiny.h: In function 'rcu_barrier_sched':
> 	include/linux/rcutiny.h:55:20: internal compiler error: Segmentation
> 	fault
> 	  static inline void rcu_barrier_sched(void)
> 
> build failure after ec90a194a "rcu: Create a synchronize_rcu_mult()"
> and 114b7fd4b "rcu: Create rcu_sync infrastructure" meet each other.

and just in case... make make kernel/rcu/rcutorture.o fails the same
way if CONFIG_RCU_TORTURE_TEST && CONFIG_TINY_RCU. So we need a work-
around even before/without rcu_sync.

Oleg.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-08-25 19:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-24 18:34 h8300 build failures ijn linux-next Guenter Roeck
2015-08-25  5:56 ` Yoshinori Sato
2015-08-25 14:27   ` Mark Salter
2015-08-25 15:03     ` h8300 build failures in linux-next (in rcu code, gcc 5.x related, not limited to h8300) Guenter Roeck
2015-08-25 16:11       ` Oleg Nesterov
2015-08-25 16:23         ` Oleg Nesterov
2015-08-25 16:51       ` Yoshinori Sato
2015-08-25 17:34         ` Oleg Nesterov
2015-08-25 18:02           ` Oleg Nesterov
2015-08-25 18:16             ` Mark Salter
2015-08-25 18:45       ` [PATCH] rcu: change _wait_rcu_gp() to work around gcc 67055 bug Oleg Nesterov
2015-08-25 19:00         ` Paul E. McKenney
2015-08-25 19:02         ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox