basic asm and memory clobbers
Jeff Law
law@redhat.com
Mon Nov 23 20:37:00 GMT 2015
On 11/23/2015 03:04 AM, Andrew Haley wrote:
> On 21/11/15 12:56, David Wohlferd wrote:
>> So, what now?
>>
>> While I'd like to take the big step and start kicking out warnings for
>> non-top-level right now, that may be too bold for phase 3. A more
>> modest step for v6 would just provide a way to find them (maybe
>> something like -Wnon-top-basic-asm or -Wonly-top-basic-asm) and doc the
>> current behavior as well as the upcoming change.
>
> Warnings would be good.
>
> My warning still holds: there are modes of compilation on some
> machines where you can't clobber all registers without causing reload
> failures. This is why Jeff didn't fix this in 1999. So, if we really
> do want to clobber "all" registers in basic asm it'll take a lot of
> work.
Exactly. In retrospect, I probably should have generated more tests for
those conditions back in '99. Essentially they'd document a class of
problems we'd like to fix over time.
I know some have been addressed in various forms, but it hasn't been
systematic.
My recommendation here is to:
1. Note in the docs what the behaviour should be. This guides where
we want to go from an implementation standpoint. I think it'd be fine
to *suggest* only using old style asms at the toplevel, but I'm less
convinced that mandating that restriction is wise.
2. As we come across failures for adhere to the desired behaviour,
fix or document them as known inconsistencies. If we find that some
are inherently un-fixable, then we'll need to tighten the docs around
those.
The more I think about it, I'm just not keen on forcing all those
old-style asms to change.
jeff
More information about the Gcc
mailing list