This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/17884] [4.0 Regression] asm 'volatile' is not honored as documented
- From: "amacleod at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Oct 2004 14:35:11 -0000
- Subject: [Bug tree-optimization/17884] [4.0 Regression] asm 'volatile' is not honored as documented
- References: <20041007193056.17884.fjahanian@apple.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From amacleod at redhat dot com 2004-10-08 14:35 -------
So after a discussion, I dont think the patch will be applied.
A follow on sentence in the documentation reads:
"Note that even a volatile asm instruction can be moved in ways
that appear insignificant to the compiler, such as across jump
instructions. You can't expect a sequence of volatile asm
instructions to remain perfectly consecutive. If you want consecutive
output, use a single asm. Also, GCC will perform some
optimizations across a volatile asm instruction; GCC does not
``forget everything'' when it encounters a volatile asm
instruction the way some other compilers do."
Thats what it is doing in this case, we are moving unrelated instructions across
the volatile asm.
RTH suggested that we remove the sentence "In addition, GCC will not reschedule
instructions across a volatile asm instruction." from the documention since it
is incorrect given the above note.
It you need instructions not to be moved across a volatile, they must be exposed
in the asm.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17884