This is the mail archive of the gcc-patches@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]

Re: PR 17884



On Oct 13, 2004, at 11:17 AM, Richard Henderson wrote:


On Wed, Oct 13, 2004 at 10:52:06AM -0700, Dale Johannesen wrote:
-If you write an @code{asm} instruction with no outputs, GCC will know
-the instruction has side-effects and will not delete the instruction or
-move it outside of loops.

I don't see this put back somewhere. Basically, no outputs implies volatile.

But it is not true that it can't be moved outside of loops, right?
And the no-outputs case subsumes the no-operands case, so I'll just
change the latter, like this (only the tail of the whole patch). OK now?



+Similarly, you can't expect a +sequence of volatile @code{asm} instructions to remain perfectly +consecutive. If you want consecutive output, use a single @code{asm}. +Also, GCC will perform some optimizations across a volatile @code{asm} +instruction; GCC does not ``forget everything'' when it encounters +a volatile @code{asm} instruction the way some other compilers do. + +An @code{asm} instruction without any output operands will be treated +identically to a volatile @code{asm} instruction.

 It is a natural idea to look for a way to give access to the condition
 code left by the assembler instruction.  However, when we attempted to


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