Re: [PATCH] ira: volatile asm's are not moveable (PR82602)

2017-10-18 Thread Vladimir Makarov
On 10/18/2017 06:48 AM, Segher Boessenkool wrote: A volatile asm statement can not be moved (relative to other volatile asm, etc.), but IRA could do it nevertheless. This patch fixes it. Testing on powerpc64-linux {-m32,-m64}; okay if it succeeds? Also for backports? Although I am not an

Re: [PATCH] ira: volatile asm's are not moveable (PR82602)

2017-10-18 Thread Segher Boessenkool
On Wed, Oct 18, 2017 at 05:17:19PM +0200, Michael Matz wrote: > On Wed, 18 Oct 2017, Segher Boessenkool wrote: > > > Certainly. And to work around the bug, it should work to mention some > > hard register as asm input. Ideally something that is live anyway; > > perhaps the stack pointer :-)

Re: [PATCH] ira: volatile asm's are not moveable (PR82602)

2017-10-18 Thread Michael Matz
Hi, On Wed, 18 Oct 2017, Segher Boessenkool wrote: > Certainly. And to work around the bug, it should work to mention some > hard register as asm input. Ideally something that is live anyway; > perhaps the stack pointer :-) Like so: > > __asm volatile ("mrs %0,PRIMASK" : "=r" (status) ::

Re: [PATCH] ira: volatile asm's are not moveable (PR82602)

2017-10-18 Thread Segher Boessenkool
On Wed, Oct 18, 2017 at 01:50:31PM +, Bernd Edlinger wrote: > Yes, the volatile is still necessary. Certainly. And to work around the bug, it should work to mention some hard register as asm input. Ideally something that is live anyway; perhaps the stack pointer :-) Like so: __asm

Re: [PATCH] ira: volatile asm's are not moveable (PR82602)

2017-10-18 Thread Bernd Edlinger
On 10/18/17 15:46, Segher Boessenkool wrote: > On Wed, Oct 18, 2017 at 06:30:23AM -0500, Segher Boessenkool wrote: >> On Wed, Oct 18, 2017 at 11:10:48AM +, Bernd Edlinger wrote: >>> A memory clobber would also make rtx_moveable_p return false, >>> thru the following case: >>> >>> case

Re: [PATCH] ira: volatile asm's are not moveable (PR82602)

2017-10-18 Thread Segher Boessenkool
On Wed, Oct 18, 2017 at 06:30:23AM -0500, Segher Boessenkool wrote: > On Wed, Oct 18, 2017 at 11:10:48AM +, Bernd Edlinger wrote: > > A memory clobber would also make rtx_moveable_p return false, > > thru the following case: > > > > case MEM: > > if (type == OP_IN && MEM_READONLY_P

Re: [PATCH] ira: volatile asm's are not moveable (PR82602)

2017-10-18 Thread Bernd Edlinger
On 10/18/17 13:30, Segher Boessenkool wrote: > On Wed, Oct 18, 2017 at 11:10:48AM +, Bernd Edlinger wrote: >> A memory clobber would also make rtx_moveable_p return false, >> thru the following case: >> >> case MEM: >>if (type == OP_IN && MEM_READONLY_P (x)) >> return

Re: [PATCH] ira: volatile asm's are not moveable (PR82602)

2017-10-18 Thread Segher Boessenkool
On Wed, Oct 18, 2017 at 11:10:48AM +, Bernd Edlinger wrote: > A memory clobber would also make rtx_moveable_p return false, > thru the following case: > > case MEM: > if (type == OP_IN && MEM_READONLY_P (x)) > return rtx_moveable_p ( (x, 0), OP_IN); > return false; >

Re: [PATCH] ira: volatile asm's are not moveable (PR82602)

2017-10-18 Thread Bernd Edlinger
Hi Segher, the patch looks ok for me. Just for my understanding: A memory clobber would also make rtx_moveable_p return false, thru the following case: case MEM: if (type == OP_IN && MEM_READONLY_P (x)) return rtx_moveable_p ( (x, 0), OP_IN); return false; ... case

[PATCH] ira: volatile asm's are not moveable (PR82602)

2017-10-18 Thread Segher Boessenkool
A volatile asm statement can not be moved (relative to other volatile asm, etc.), but IRA could do it nevertheless. This patch fixes it. Testing on powerpc64-linux {-m32,-m64}; okay if it succeeds? Also for backports? Segher 2017-10-18 Segher Boessenkool