This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/44492] auto-inc-dec pushes PRE_MODIFY/PRE_INC into inline asm operands
- From: "matz at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jun 2010 12:26:27 -0000
- Subject: [Bug middle-end/44492] auto-inc-dec pushes PRE_MODIFY/PRE_INC into inline asm operands
- References: <bug-44492-87@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from matz at gcc dot gnu dot org 2010-06-10 12:26 -------
I don't think it ever was intended that 'm' includes operands with embedded
side-effects. I don't think so because making this work reliably is
relatively difficult. In particular the tests that Jakub mentions would need
implementation (and probably other changes too), and the point is that such
things never were implemented. Hence with enough work it's probably possible
to construct testcases also for much older versions of GCC that fail in
similar ways.
If that means to slightly change the definition of 'm' compared to what is
documented currently, well, so be it. The other definition is unreliable
anyway, so any inline asm that uses 'm' and expects a side-effect is fishy
at best.
It is fishy because if the compiler forwards a side-effect into the operands
it would have to rewrite the inline asm string to actually contain an
instruction to calculate this side-effect, which obviously is bollocks.
So, yes, auto-inc-dec should of course _not_ push side-effects into inline
asm.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44492