PATCH: PR target/38941: CX isn't preserved with shift

H.J. Lu hongjiu.lu@intel.com
Tue Jan 27 00:21:00 GMT 2009


People may not be aware that gcc may clobber a register when
generating some operations, like variable shift, memory copy or memory
move on x86. This path mentions this possibility. OK for trunk?

Thanks.


H.J.
----
2009-01-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/38941
	* doc/extend.texi: Improve local variable with asm reg.

--- gcc/doc/extend.texi.foo	2009-01-26 09:50:17.000000000 -0800
+++ gcc/doc/extend.texi	2009-01-26 15:43:54.000000000 -0800
@@ -4852,6 +4852,8 @@ asm ("sysint" : "=r" (result) : "0" (p1)
 In the above example, beware that a register that is call-clobbered by
 the target ABI will be overwritten by any function call in the
 assignment, including library calls for arithmetic operators.
+Also a register may be clobbered when generating some operations,
+like variable shift, memory copy or memory move on x86.
 Assuming it is a call-clobbered register, this may happen to @code{r0}
 above by the assignment to @code{p2}.  If you have to use such a
 register, use temporary variables for expressions between the register



More information about the Gcc-patches mailing list