This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Condition code testing after inline assembly
- To: Andi Kleen <ak at muc dot de>
- Subject: Re: Condition code testing after inline assembly
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Fri, 23 Jan 1998 00:52:53 -0700
- cc: egcs at cygnus dot com
- Reply-To: law at cygnus dot com
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