This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc torture test pr52286.c
- From: Jeff Law <law at redhat dot com>
- To: pshortis at dataworx dot com dot au, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 28 Aug 2017 09:07:34 -0600
- Subject: Re: gcc torture test pr52286.c
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=law at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2FD105277E
- References: <59A38EFD.5060109@dataworx.com.au>
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