Put optimization/7871 patches on gcc 3.3 and 3.4 branches

Ian Lance Taylor ian@wasabisystems.com
Sat Feb 28 09:39:00 GMT 2004


Mark Mitchell <mark@codesourcery.com> writes:

> Ian Lance Taylor wrote:
> 
> > I propose putting the patch for optimization/7871 onto the 3.3 and 3.4
> > branches.  I've confirmed that the x86 and m68k test cases in that PR
> > are currently broken on both branches, and that this patch fixes those
> > test cases on both branches.  I believe that this patch is reasonably
> > safe, as it only affects global register variables.
> 
> What is the difference in semantics between SET and CLOBBER in this
> context?  Why does your patch help?

That part of the patch is Eric's.  It helps because CLOBBER causes a
REG_DEAD note to be put on the CALL insn, which is not correct for a
global register variable.  The value is not clobbered.  However, it is
not safe to assume that the register has the same value after the
call.

> I'm also not sure using SET is safe.  On an architecture like IA64
> (with NAT bits), does using a SET cause the compiler to think that the
> register has a well-defined value as opposed to a NAT value?

It seems to me that in principle a global register always has a
well-defined value, at least when it is used.  Anything else would be
a case of programmer error.  The compiler should never think that a
global register does not have a well-defined value.

Ian



More information about the Gcc-patches mailing list