asm volatile statement reordering

Andrew Haley aph@redhat.com
Tue Oct 17 08:12:00 GMT 2017


On 17/10/17 09:01, Jeffrey Walton wrote:
> On Tue, Oct 17, 2017 at 3:58 AM, Andrew Haley <aph@redhat.com> wrote:
>> 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.
> 
> Forgive my ignorance... How does one do it without ASM and in a
> cross-platform fashion?

I don't understand what you are asking.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the Gcc-help mailing list