Re: Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread David Daney
On 09/30/2013 12:03 PM, Geert Uytterhoeven wrote: On Mon, Sep 30, 2013 at 7:45 PM, David Daney wrote: What about using __builtin_unreachable when we can but turn off warnings and use do{}while(0) when __builtin_unreachable does not exist? This seems the both worlds. Newer compilers produce

Re: Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread Geert Uytterhoeven
On Mon, Sep 30, 2013 at 7:45 PM, David Daney wrote: >> What about using __builtin_unreachable when we can but turn off warnings >> and use do{}while(0) when __builtin_unreachable does not exist? This seems >> the both worlds. Newer compilers produce better code with unreachable >> anyways. >> >

Re: Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread David Daney
On 09/30/2013 10:15 AM, Pinski, Andrew wrote: On Sep 30, 2013, at 9:20 AM, "David Daney" wrote: On 09/30/2013 07:56 AM, Ralf Baechle wrote: Lately I received several patches for build issues that only strike if CONFIG_BUG is disabled. Here's a test case extracted from one of them: /* *

Re: Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread Pinski, Andrew
> On Sep 30, 2013, at 9:20 AM, "David Daney" wrote: > >> On 09/30/2013 07:56 AM, Ralf Baechle wrote: >> Lately I received several patches for build issues that only strike if >> CONFIG_BUG is disabled. Here's a test case extracted from one of them: >> >> /* >> * Definition of BUG taken from

Re: Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread David Daney
On 09/30/2013 07:56 AM, Ralf Baechle wrote: Lately I received several patches for build issues that only strike if CONFIG_BUG is disabled. Here's a test case extracted from one of them: /* * Definition of BUG taken from asm-generic/bug.h for the CONFIG_BUG=n case */ #define BUG() do {}

Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread Ralf Baechle
Lately I received several patches for build issues that only strike if CONFIG_BUG is disabled. Here's a test case extracted from one of them: /* * Definition of BUG taken from asm-generic/bug.h for the CONFIG_BUG=n case */ #define BUG() do {} while(0) int foo(int arg) { int res;

Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread Ralf Baechle
Lately I received several patches for build issues that only strike if CONFIG_BUG is disabled. Here's a test case extracted from one of them: /* * Definition of BUG taken from asm-generic/bug.h for the CONFIG_BUG=n case */ #define BUG() do {} while(0) int foo(int arg) { int res;

Re: Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread David Daney
On 09/30/2013 07:56 AM, Ralf Baechle wrote: Lately I received several patches for build issues that only strike if CONFIG_BUG is disabled. Here's a test case extracted from one of them: /* * Definition of BUG taken from asm-generic/bug.h for the CONFIG_BUG=n case */ #define BUG() do {}

Re: Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread Pinski, Andrew
On Sep 30, 2013, at 9:20 AM, David Daney ddaney.c...@gmail.com wrote: On 09/30/2013 07:56 AM, Ralf Baechle wrote: Lately I received several patches for build issues that only strike if CONFIG_BUG is disabled. Here's a test case extracted from one of them: /* * Definition of BUG taken

Re: Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread David Daney
On 09/30/2013 10:15 AM, Pinski, Andrew wrote: On Sep 30, 2013, at 9:20 AM, David Daney ddaney.c...@gmail.com wrote: On 09/30/2013 07:56 AM, Ralf Baechle wrote: Lately I received several patches for build issues that only strike if CONFIG_BUG is disabled. Here's a test case extracted from

Re: Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread Geert Uytterhoeven
On Mon, Sep 30, 2013 at 7:45 PM, David Daney ddaney.c...@gmail.com wrote: What about using __builtin_unreachable when we can but turn off warnings and use do{}while(0) when __builtin_unreachable does not exist? This seems the both worlds. Newer compilers produce better code with unreachable

Re: Issue with BUG() in asm-gemeric/bug.h if CONFIG_BUG=n

2013-09-30 Thread David Daney
On 09/30/2013 12:03 PM, Geert Uytterhoeven wrote: On Mon, Sep 30, 2013 at 7:45 PM, David Daney ddaney.c...@gmail.com wrote: What about using __builtin_unreachable when we can but turn off warnings and use do{}while(0) when __builtin_unreachable does not exist? This seems the both worlds.