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: Jakub Jelinek <jakub at redhat dot com>
- To: David Wohlferd <dw at LimeGreenSocks dot com>
- Cc: matz at suse dot de, Andrew Haley <aph at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 22 Jun 2016 11:39:21 +0200
- 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> <5a61d402-3f8d-b8c1-3ffe-cf72ce0678ad at LimeGreenSocks dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Jun 22, 2016 at 02:23:46AM -0700, David Wohlferd wrote:
> I don't have a sample of people accessing local variables, but I do have one
> where someone was using 'scratch' registers in BAIF assuming the compiler
> would just "handle it." And before you call that guy a dummy, let me point
> out that under some compilers, that's a perfectly valid assumption for asm.
> And even if not, it may have been working "just fine" in his implementation
> for years. Which doesn't make it right.
And how would deprecation of basic asm help with that?
People can as well use 'scratch' registers in extended asm without
mentioning them in outputs or clobbers (and there are many real-world
examples of that that sometimes happen to "work" by accident).
> On the other hand, there is no guarantee that they are actually correct
> right now. Correct enough? Maybe so. But of course there's no guarantee
> that tomorrow's newest optimization won't bork some of them because it
> followed the rules and you didn't quite.
You don't have such guarantee for extended asm either, lots of
them are just ticking bombs that will fail when anything in the compiler is
changed.
Jakub