This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/44492] auto-inc-dec pushes PRE_MODIFY/PRE_INC into inline asm operands



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]