Re: [PATCH 3/3] powerpc: use __builtin_trap() in BUG/WARN macros.

2019-08-23 Thread Christophe Leroy
On 08/19/2019 03:45 PM, Segher Boessenkool wrote: On Mon, Aug 19, 2019 at 05:05:46PM +0200, Christophe Leroy wrote: Le 19/08/2019 à 16:37, Segher Boessenkool a écrit : On Mon, Aug 19, 2019 at 04:08:43PM +0200, Christophe Leroy wrote: Le 19/08/2019 à 15:23, Segher Boessenkool a écrit : On M

Re: [PATCH 3/3] powerpc: use __builtin_trap() in BUG/WARN macros.

2019-08-19 Thread Segher Boessenkool
On Mon, Aug 19, 2019 at 05:05:46PM +0200, Christophe Leroy wrote: > Le 19/08/2019 à 16:37, Segher Boessenkool a écrit : > >On Mon, Aug 19, 2019 at 04:08:43PM +0200, Christophe Leroy wrote: > >>Le 19/08/2019 à 15:23, Segher Boessenkool a écrit : > >>>On Mon, Aug 19, 2019 at 01:06:31PM +, Christo

Re: [PATCH 3/3] powerpc: use __builtin_trap() in BUG/WARN macros.

2019-08-19 Thread Christophe Leroy
Le 19/08/2019 à 16:37, Segher Boessenkool a écrit : On Mon, Aug 19, 2019 at 04:08:43PM +0200, Christophe Leroy wrote: Le 19/08/2019 à 15:23, Segher Boessenkool a écrit : On Mon, Aug 19, 2019 at 01:06:31PM +, Christophe Leroy wrote: Note that we keep using an assembly text using "twi 31,

Re: [PATCH 3/3] powerpc: use __builtin_trap() in BUG/WARN macros.

2019-08-19 Thread Segher Boessenkool
On Mon, Aug 19, 2019 at 04:08:43PM +0200, Christophe Leroy wrote: > Le 19/08/2019 à 15:23, Segher Boessenkool a écrit : > >On Mon, Aug 19, 2019 at 01:06:31PM +, Christophe Leroy wrote: > >>Note that we keep using an assembly text using "twi 31, 0, 0" for > >>inconditional traps because GCC drop

Re: [PATCH 3/3] powerpc: use __builtin_trap() in BUG/WARN macros.

2019-08-19 Thread Christophe Leroy
Le 19/08/2019 à 15:23, Segher Boessenkool a écrit : On Mon, Aug 19, 2019 at 01:06:31PM +, Christophe Leroy wrote: Note that we keep using an assembly text using "twi 31, 0, 0" for inconditional traps because GCC drops all code after __builtin_trap() when the condition is always true at bu

Re: [PATCH 3/3] powerpc: use __builtin_trap() in BUG/WARN macros.

2019-08-19 Thread Segher Boessenkool
On Mon, Aug 19, 2019 at 01:06:31PM +, Christophe Leroy wrote: > Note that we keep using an assembly text using "twi 31, 0, 0" for > inconditional traps because GCC drops all code after > __builtin_trap() when the condition is always true at build time. As I said, it can also do this for condit

[PATCH 3/3] powerpc: use __builtin_trap() in BUG/WARN macros.

2019-08-19 Thread Christophe Leroy
The below exemples of use of WARN_ON() show that the result is sub-optimal in regard of the capabilities of powerpc. void test_warn1(unsigned long long a) { WARN_ON(a); } void test_warn2(unsigned long a) { WARN_ON(a); } void test_warn3(unsigned long a, unsigned long b) {