This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc torture test pr52286.c


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 closer to what you want:

asm ("" : "=r" (a) : "n" (0));

The "n" says accept any immediate integer constant with a compile time
known value.


In fact, I could probably argue that "0" (0) should generate an error as
a constraint -- it's meaningless in that you can't match a constant
integer input to any output.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]