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

Re: Condition code testing after inline assembly



  In message <k2soqishj9.fsf@zero.aec.at>you write:
  > I recently wanted to test the condition codes generated by an inline
  > assembler statement. I then found this statement in the info pages:
  > 
  > ``   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 implement this, we found no way to make it work reliably.
  > The problem is that output operands might need reloading, which would
  > result in additional following "store" instructions.  On most machines,
  > these instructions would alter the condition code before there was time
  > to test it.  This problem doesn't arise for ordinary "test" and
  > "compare" instructions because they don't have any output operands. ''
  > 
  > I don't understand this. Why is not possible to first test the
  > condition, branch and then duplicate the necessary reloads for output
  > operands in both paths? Any insights on this would be appreciated.
But how does the compiler know how to duplicate the tests after output
reloading?

jeff


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