GCC Compiler Optimization ignores or mistreats MFENCE memory barrier related instruction

Alexander Monakov amonakov@ispras.ru
Fri Apr 13 12:34:00 GMT 2018


On Fri, 13 Apr 2018, Vivek Kinhekar wrote:
> The mfence instruction with memory clobber asm instruction should create a
> barrier between division and printf instructions.

No, floating-point division does not touch memory, so the asm does not (and
need not) restrict its motion.

Alexander



More information about the Gcc mailing list