[Bug inline-asm/85546] GCC assumes volatile asm block returns same value in loop

2018-04-27 Thread amonakov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85546

Alexander Monakov  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||amonakov at gcc dot gnu.org
 Resolution|--- |INVALID

--- Comment #3 from Alexander Monakov  ---
I'm not sure Richard is correct about the definition of volatile asms: similar
to reads of volatile objects, volatile asms can produce different output on
each invocation (iow they are not pure/const).

In any case the inline asm in io() is missing clobbers for rcx, r11 and memory,
which makes the bug invalid.

[Bug inline-asm/85546] GCC assumes volatile asm block returns same value in loop

2018-04-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85546

--- Comment #2 from Richard Biener  ---
I think this is a misconception of what a volatile asm is.  Volatile says
there may be additional side-effects the asm performs - it does _not_ mean
the output depends on more than the inputs.

Note I can't reproduce your findings but your instructions for reproduction are
somewhat incomplete.

[Bug inline-asm/85546] GCC assumes volatile asm block returns same value in loop

2018-04-26 Thread be11f157cd19c4a2ba1e9c70a38b1a74 at protonmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85546

--- Comment #1 from be11f157cd19c4a2ba1e9c70a38b1a74 at protonmail dot com ---
The code sample is compiled with

gcc -ffreestanding -nostdlib -nostartfiles main.c