From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: alan@SPRI.Levels.UniSA.Edu.Au Cc: binutils@sourceware.cygnus.com Subject: Re: Overflow fix (was Problems with trampoline.S with 64 bit binutils) Date: Wed, 28 Jul 1999 15:50:00 -0000 Message-id: <19990728224953.712.qmail@daffy.airs.com> References: X-SW-Source: 1999-07/msg00024.html Date: Wed, 28 Jul 1999 18:39:18 +0930 (CST) From: Alan Modra Is it OK for me to check this one in, Ian? It's almost in the "obvious fix" category... Almost. > + mask <<= size * 8 - (fixP->fx_signed ? 1 : 0); If size is 4 and fixP->fx_signed is not set, then this will do a left shift by 32. If mask is itself 32 bits, then this is not defined by ANSI C. There are in fact compilers which will turn this into a no-op: they generate a shift by 32 instruction, which is masked into a shift by 0 instruction. That's why I had the two shifts in the old code, and I think we need to keep that. Ian