This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Make basic asm implicitly clobber memory
- From: Andrew Haley <aph at redhat dot com>
- To: David Wohlferd <dw at LimeGreenSocks dot com>, Bernd Edlinger <bernd dot edlinger at hotmail dot de>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Jeff Law <law at redhat dot com>, Bernd Schmidt <bschmidt at redhat dot com>, Richard Biener <rguenther at suse dot de>, Jakub Jelinek <jakub at redhat dot com>
- Date: Sat, 7 May 2016 18:38:34 +0100
- Subject: Re: [PATCH] Make basic asm implicitly clobber memory
- Authentication-results: sourceware.org; auth=none
- References: <AM4PR07MB157101A1194D2A45C841E506E47C0 at AM4PR07MB1571 dot eurprd07 dot prod dot outlook dot com> <aaac3ec1-d7cb-b046-b69d-c918aee952ee at LimeGreenSocks dot com>
On 06/05/16 07:35, David Wohlferd wrote:
> 1) I'm not clear precisely what problem this patch fixes. It's true
> that some people have incorrectly assumed that basic asm clobbers
> memory and this change would fix their code. But some people also
> incorrectly assume it clobbers registers. I assume that's why Jeff
> Law proposed making basic asm "an opaque blob that
> read/write/clobber any register or memory location."
A few more things:
Jeff Law did propose this, but it's impossible to do because it
inevitably causes reload failures.
My argument in support of Bernd's proposal is that it makes sense from
a *practical* software reliability point of view. It wouldn't hurt,
and might fix some significant bugs. It's similar to the targets
which always implicitly clobber "cc". It corresponds to what I always
assumed basic asm did, and I'm sure that I'm not alone. This change
might fix some real bugs and it is extremely unlikely to break
anything.
Andrew.