On 07/06/2016 08:32 AM, Jan Beulich wrote:
While it always seemed wrong to me that there's no way to avoid the
default "flags" and "fpsr" clobbers, the regression the fix for
PR/60663 introduced (see PR/63637) makes it even more desirable to have
such a mechanism: This way, at least asm()s with a single output and no
explicit clobbers could again have been made subject to CSE even with
that bug unfixed.
---
There wasn't much feedback on v1
(https://gcc.gnu.org/ml/gcc-patches/2014-10/msg03251.html)
and the feedback I did get from Jeff I didn't really mean to address
in this version:
I really don't like having an option that's globally applied for this
feature. THough I am OK with having a mechanism to avoid
implicit clobbers on specific ASMs.
I don't really understand what's wrong with a command line option
allowing to state this globally for a source file or even entire project.
It's been a while, but I believe my concern was that if you flip a flag
globally, then it's an all-or-nothing proposition. ie, you either have
default clobbers or you do not have default clobbers for the affected
TU. While that may be OK for some projects, I think that folks will
want/need this applied on a per-asm basis far far more often. That's
just my opinion -- I don't have anything hard to back that up.
Why use negative numbers for the hard register numbers? I
wouldn't be at all surprised if lots of random code assumes
register numbers are always positive.
I'm lacking an idea (or suggestion) of a better alternative. Using
positive numbers resulted in far more problems, as such registers
then got accepted elsewhere as valid too.
Sadly, I don't have a better suggestion. Perhaps Bernd or someone else
has ideas on how to represent.
I don't like adding new registers with special names like !foo.
Instead I think that listing "!cc" or something similar in the asm
itself if it doesn't clobber the cc register would be better.
I didn't really understand what was meant here, i.e. how the
proposed alternative was supposed to look like in an actual
asm().
I think what I was suggesting was to use the !<name> syntax, but not as
a distinct register name. ie, the ! essentially could be applied to any
register and would be handled outside the target specific bits.
Though I think this implies a new API for decode_reg_name_and_count
where certain negative values have special meaning. But that ought to
be trivial.
Jeff