[PATCH] Make basic asm implicitly clobber memory
Jeff Law
law@redhat.com
Wed May 18 22:07:00 GMT 2016
On 05/07/2016 11:38 AM, Andrew Haley wrote:
> 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.
Right.
>
> 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.
And by making basic asms use/clobber memory in particular, it means code
using them is less likely to break as the optimizers continue to get
smarter about memory loads/stores.
I haven't gone through the actual patch yet, but I like it's basic goals.
Jeff
More information about the Gcc-patches
mailing list