Re: gcc torture test pr52286.c

2017-08-31 Thread Georg-Johann Lay
Paul S schrieb: I've ported gcc to a 16 bit CPU and have all torture tests passing bar one, pr52286.c The offending lines of code are long a, b = 0; asm ("" : "=r" (a) : "0" (0)); which should cause zero to be assigned to the "a" SI sized variable. Inspecting the generated code revealed t

Re: gcc torture test pr52286.c

2017-08-29 Thread Segher Boessenkool
On Mon, Aug 28, 2017 at 05:49:22PM -0600, Jeff Law wrote: > Going back to pshortis issue, it's interesting how the size of the input > operand is being used to determine the mode of the matching output > operand. That ought to be not-too-difficult to find within GCC... With > any luck there'd be

Re: gcc torture test pr52286.c

2017-08-29 Thread Michael Matz
Hi, On Mon, 28 Aug 2017, Jeff Law wrote: > > asm ("" : "=r" (x) : "r" (y+z)); > > asm ("" : "=r" (x) : "r" (z)); > > asm ("" : "=r" (x) : "r" (42)); > > > > > (are we still agreeing on this? I'm having a problem understanding why > > you think the above wouldn't work) > > How do we rep

Re: gcc torture test pr52286.c

2017-08-28 Thread Jeff Law
On 08/28/2017 11:56 AM, Michael Matz wrote: > Hi, > > On Mon, 28 Aug 2017, Jeff Law wrote: > >> I can't remember matching constraints ever working that way. > > They do work exactly so. These uses are all correct, though they place > some random value into x: Hmm, maybe I've spent too much tim

Re: gcc torture test pr52286.c

2017-08-28 Thread Paul S
Thanks Michael (and Jeff) I shared your view about the mode of the output register not being reflected to the input until I saw (asm_operands:SI ("") ("=r") 0 [ (reg:HI 30) ] then I was unsure whether the input was affecting the output or the output mode w

Re: gcc torture test pr52286.c

2017-08-28 Thread Michael Matz
Hi, On Mon, 28 Aug 2017, Michael Matz wrote: > On Mon, 28 Aug 2017, Jeff Law wrote: > > > I can't remember matching constraints ever working that way. > > They do work exactly so. FWIW, I was momentarily worried that there once was a world where you were right. If so (and I don't believe it)

Re: gcc torture test pr52286.c

2017-08-28 Thread Michael Matz
Hi, On Mon, 28 Aug 2017, Paul S wrote: > I've ported gcc to a 16 bit CPU and have all torture tests passing bar one, > pr52286.c > > The offending lines of code are > > long a, b = 0; > asm ("" : "=r" (a) : "0" (0)); > > > which should cause zero to be assigned to the "a" SI sized variabl

Re: gcc torture test pr52286.c

2017-08-28 Thread Michael Matz
Hi, On Mon, 28 Aug 2017, Jeff Law wrote: > I can't remember matching constraints ever working that way. They do work exactly so. These uses are all correct, though they place some random value into x: int x, y, z; y = z = init(); asm ("" : "=r" (x) : "r" (y+z)); asm ("" : "=r" (x) : "

Re: gcc torture test pr52286.c

2017-08-28 Thread Jeff Law
On 08/28/2017 11:33 AM, Michael Matz wrote: > Hi, > > On Mon, 28 Aug 2017, Jeff Law wrote: > >>> long a, b = 0; >>> asm ("" : "=r" (a) : "0" (0)); >> I wouldn't use a matching constraint here. Something like this is >> probably closer to what you want: >> >> asm ("" : "=r" (a) : "n" (0)); >>

Re: gcc torture test pr52286.c

2017-08-28 Thread Michael Matz
Hi, On Mon, 28 Aug 2017, Jeff Law wrote: > > long a, b = 0; > > asm ("" : "=r" (a) : "0" (0)); > I wouldn't use a matching constraint here. Something like this is > probably closer to what you want: > > asm ("" : "=r" (a) : "n" (0)); > > The "n" says accept any immediate integer constant w

Re: gcc torture test pr52286.c

2017-08-28 Thread Jeff Law
On 08/27/2017 09:33 PM, Paul S wrote: > I've ported gcc to a 16 bit CPU and have all torture tests passing bar > one, pr52286.c > > The offending lines of code are > > long a, b = 0; > asm ("" : "=r" (a) : "0" (0)); I wouldn't use a matching constraint here. Something like this is probably c

gcc torture test pr52286.c

2017-08-27 Thread Paul S
I've ported gcc to a 16 bit CPU and have all torture tests passing bar one, pr52286.c The offending lines of code are long a, b = 0; asm ("" : "=r" (a) : "0" (0)); which should cause zero to be assigned to the "a" SI sized variable. Inspecting the generated code revealed that zero was on