This is the mail archive of the
mailing list for the GCC project.
Re: basic asm and memory clobbers
- From: Jeff Law <law at redhat dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: David Wohlferd <dw at LimeGreenSocks dot com>, Paul_Koning at Dell dot com, aph at redhat dot com, rth at redhat dot com, jakub at redhat dot com, gcc at gcc dot gnu dot org, rth at gcc dot gnu dot org, pinskia at gcc dot gnu dot org, sandra at codesourcery dot com
- Date: Mon, 23 Nov 2015 22:25:26 -0700
- Subject: Re: basic asm and memory clobbers
- Authentication-results: sourceware.org; auth=none
- References: <564F46CF dot 2030403 at redhat dot com> <564FB2ED dot 70803 at LimeGreenSocks dot com> <56506A03 dot 7030609 at LimeGreenSocks dot com> <5652E4A6 dot 9090905 at redhat dot com> <56537921 dot 9070809 at redhat dot com> <565386CA dot 8080005 at LimeGreenSocks dot com> <C080D84D-C192-46F6-BAE9-9E3B5A9F766C at dell dot com> <5653BFC5 dot 5080305 at LimeGreenSocks dot com> <20151124022217 dot GB9049 at gate dot crashing dot org> <5653EC2A dot 2070001 at redhat dot com> <20151124051232 dot GC9049 at gate dot crashing dot org>
On 11/23/2015 10:12 PM, Segher Boessenkool wrote:
I think that's the wrong way to look at things -- it's not that nobody
is depending on this behaviour, it's nobody has had a problem due to
On Mon, Nov 23, 2015 at 09:48:42PM -0700, Jeff Law wrote:
On 11/23/2015 07:22 PM, Segher Boessenkool wrote:
Here is a test that shows that on at least PowerPC the basic asm is
identical to the extended asm without clobber (compile with -O2 -S and
-fno-ipa-icf if you want to have it easier to read). In this case,
the basic asm is treated as not clobbering memory at the tree level
already, before expanding to RTL.
And that IMHO, ought to be considered a bug.
I agree. Almost everyone does, as far as I can see.
The question is if we want to retain this functionality. No one has
depended on this in a long time -- they couldn't, it has been broken
since forever -- and there is another mechanism that does reliably
give this functionality (extended asm).
The first pass that goes wrong for this testcase is fre2, fwiw.
I've seen some amazing things through the years where you'd think
there's absolutely no way they could work -- but they did for a long
time with nobody noticing some absolutely horridly wrong code, that when
tickled just right would wreck havoc.
So again, I would suggest we document the desired behaviour and work
towards fixing any deviations from that behaviour.