This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: asm volatile statement reordering
- From: Andrew Haley <aph at redhat dot com>
- To: noloader at gmail dot com, David Brown <david at westcontrol dot com>
- Cc: Xi Ruoyao <ryxi at stu dot xidian dot edu dot cn>, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 17 Oct 2017 08:58:56 +0100
- Subject: Re: asm volatile statement reordering
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=aph at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 83505883A2
- References: <c77403fd-08fc-c64b-ceaf-a1cf5679c214@westcontrol.com> <1508214021.2368.1.camel@stu.xidian.edu.cn> <59E5AE88.4060707@westcontrol.com> <CAH8yC8nW4q+kZzi46fPPwzWC9xBzBvDjxHK1g=aX72S9shagwg@mail.gmail.com>
On 17/10/17 08:32, Jeffrey Walton wrote:
> GCC guesses wrong on occasion. It will remove code that has value that
> but does not produce an output because the language does not allow us
> to express it.
>
> The C language lacks what we need to express what we need to do. Its a
> failure of the C (and C++) committees. Its not a GCC failure.
I disagree. If you want a bunch of asms to execute in a particular
order, add a memory clobber or some dependencies. It's not difficult
once you have the understanding. In this particular case, fixing it
is trivial, and there are many ways to do it.
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671