libstdc++/5625: exception unwinding creates invalid pointer o n mips

cgd@broadcom.com cgd@broadcom.com
Tue Apr 23 15:00:00 GMT 2002


At Tue, 23 Apr 2002 19:47:09 +0000 (UTC), "Eric Christopher" wrote:
> On Tue, 2002-04-23 at 12:35, Ed Maste wrote:
> > Yes, the MIPS documentation states that the destination register 
> > gets the sign-extended result ("GPR[rt]<-sign_extend(temp31..0)").
> > 
> > However, note the ADDIU instruction Restrictions section:
> > 
> >      Restrictions:
> >      If GPR rs does not contain a sign-extended 
> >      32-bit value (bits 63..31 equal), then the 
> >      result of the operation is UNPREDICTABLE.
> > 
> 
> So it sounds like both your processor and gcc are in error. gcc by not
> sign extending the value before and you for not sign extending it after.

No, there is no processor error there.

If the inputs are not sign extended, the result is unpredictable,
period.  There is no guarantee of sign extension in that case.

My understanding is that if it wanted to, the processor could, well,
do anything that it wanted within the confines of the definition of
UNPREDICTABLE (i.e., no hangs or halts and no security holes).  it
could happily signal an implementation-dependent exception, return a
strange value (either consistently or inconsnstently), etc.


cgd




More information about the Gcc-bugs mailing list