On 03/28/2016 12:03 AM, David Wohlferd wrote:
On 3/24/2016 8:00 AM, Bernd Schmidt wrote:
> More problematic than a lack of documentation is that I haven't been
able to find an executable testcase. If you could adapt your example for
use in gcc.target/i386, that would be even more important.
It looks like Richard included some "scan-assembler" statements in the
suites with the original checkin
(https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=225122). Is that
not sufficient? If not, I'm certainly prepared to create a couple
executable cases for the next rev of this patch.
I don't think it's sufficient. I would like executable code that
verifies that this feature is indeed working as intended.
> I don't think the manual should point out the obvious. I'd be
surprised if this wasn't documented or at least strongly implied
elsewhere for normal operands.
Well, *I* thought it was obvious, because it is both documented and
implied elsewhere.
However, the compiler doesn't see it that way. Normally, attempting to
overlap 'clobbers' and 'outputs' generates compile errors, but not when
outputting and clobbering flags. I filed pr68095 about this (including
a rough draft at a patch), but apparently not everyone sees this the way
I do.
Is there any _actual_ problem here? Like, if you combine the output and
the clobber you run into problems? Looks to me like an explicit "cc"
clobber is just ignored on x86. We just need to make sure this stays
working (testcases).
>> +Note: On the x86 platform, flags are normally considered clobbered by
>> +extended asm whether the @code{"cc"} clobber is specified or not.
>
> Is it really necessary or helpful to mention that here? Not only is
it not strictly correct (an output operand is not also considered
clobbered), but to me it breaks the flow because you're left wondering
how that sentence relates to the example (it doesn't).
The problem I am trying to fix here is that on x86, the "cc" is implicit
for all extended asm statements, whether it is specified or not and
whether there is a flags output or not. However, that fact isn't
documented anywhere. So, where does that info go? It could go right by
the docs for "cc", but since this behavior only applies to x86, that
would make the docs there messy.
My question would be, can this information ever be relevant to users?
They may notice that their code still works if they omit the "cc", but
that's not really a habit we want to encourage. I think this is an
internal implementation detail that doesn't necessarily even have to be
documented.
Bernd