This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Deprecating basic asm in a function - What now?
- From: Andrew Haley <aph at redhat dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 21 Jun 2016 17:33:09 +0100
- Subject: Re: Deprecating basic asm in a function - What now?
- Authentication-results: sourceware.org; auth=none
- References: <dc3ca16c-3521-757f-fcf0-50061f510f75 at LimeGreenSocks dot com> <alpine dot LSU dot 2 dot 20 dot 1606201931460 dot 13156 at wotan dot suse dot de> <57682A85 dot 4060803 at redhat dot com> <alpine dot LSU dot 2 dot 20 dot 1606201941340 dot 13156 at wotan dot suse dot de> <57690227 dot 2050501 at redhat dot com> <alpine dot LSU dot 2 dot 20 dot 1606211401150 dot 13156 at wotan dot suse dot de>
Hi,
On 21/06/16 13:08, Michael Matz wrote:
> On Tue, 21 Jun 2016, Andrew Haley wrote:
>
>>> As said in the various threads about basic asms, all correctness
>>> problems can be solved by making GCC more conservative in handling
>>> them (or better said: not making it less conservative).
>>
>> Well, yes. That's exactly why we've agreed to change basic asms to make
>> them clobber memory, i.e. to make GCC more conservative.
>
> Exactly. But this thread is about something else, see subject.
Well, you brought up the idea of making GCC "less conservative". But
making GCC less conservative is something that we have not agreed to
do. So why did you even mention it if it wasn't relevant?
>> Well, maybe. It's also fairly likely that many work by accident. IMO
>> this is more of a statement of hope than any kind of reasonable
>> expectation.
>
> Like yours, of course.
Hmm. The problem is that programmers have false ideas about basic
asms. I was one of those programmers: I "knew" that basic asms
implicitly clobbered memory, and I was startled to find out I was
wrong. And I have been a GCC mainatiner for a long time. I guess it
is possible that all of those uses of basic asm David mentioned are in
fact correct. It's likely that adding a memory clobber will help.
But some things I have seen (such as changing the floating-point
status register) may not be be reliable without inputs and outputs and
should be fixed.
On the one hand we have the risk of churn, but basic asm in a function
isn't such a great idea anyway.
Andrew.