This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] x86: allow to suppress default clobbers added to asm()s


On 11/03/14 01:11, Jan Beulich wrote:
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.

Why not? That way, for projects/components knowing all their
asm()s have all clobbers explicitly specified they could avoid
having to touch all of them and instead just pass the new option.
That said - if the option isn't being liked, I'm fine dropping it.
In general, I doubt projects are going to achieve and maintain that level of knowledge about their asms. It's just asking for subtle bugs in the long run.



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 think I want through all relevant places, and fixed the one where
the assumption was wrongly made. The nice thing about using
negative numbers here is that there is already at least one place
where negative numbers aren't valid, and we want them to not be
valid there.

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.

You mean interpreting the ! in generic code? Doable, but not very
nice imo considering that the default addition of clobbers is limited
to very few architectures, plus dealing with this in a generic way
would - afaict - make the change quite a bit more intrusive.
yes, precisely. This is a generic concept and while more invasive, I think what we get in the end is going to ultimately be better.

I also suspect other targets ought to be defining those implicit clobbers, but don't :(

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]