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: egcs 1.0.1 miscompiles Linux 2.0.33


On Sun, Mar 01, 1998 at 01:59:56PM -0800, Linus Torvalds wrote:
> 	#define restore_flags(restore_value) \
> 		asm("rdwrexception %0\n\t" \
> 		    "andl $0xfffffffe,%0\n\t" \
> 		    "orl %1,%0\n\t" \
> 		    "rdwrexception %0" \
> 		    : /* no outputs */ \
> 		    :"c" (0xffffffff), \
> 		     "g" (restore_value) \
> 		    :"cx")
> 
> Now, how should I re-write this to avoid the clobber?
> 
> I could use "=c" and "0" to tell gcc that %ecx is a read-write thing and
> will change. But that doesn't tell gcc that it mustn't use %ecx for the
> value in "restore_value"

You should use "=&c" to say that the output should use a new register.
That output will be shared with no other input except an explicit "0".


r~


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