From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9415 invoked by alias); 23 Apr 2002 20:56:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 9402 invoked by uid 71); 23 Apr 2002 20:56:02 -0000 Date: Tue, 23 Apr 2002 13:56:00 -0000 Message-ID: <20020423205602.9395.qmail@sources.redhat.com> To: echristo@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: cgd@broadcom.com Subject: Re: libstdc++/5625: exception unwinding creates invalid pointer o n mips Reply-To: cgd@broadcom.com X-SW-Source: 2002-04/txt/msg01220.txt.bz2 List-Id: The following reply was made to PR libstdc++/5625; it has been noted by GNATS. From: cgd@broadcom.com To: echristo@redhat.com Cc: "Ed Maste" , "'echristo@gcc.gnu.org'" , "'gcc-bugs@gcc.gnu.org'" , "'gcc-prs@gcc.gnu.org'" , "'gcc-gnats@gcc.gnu.org'" Subject: Re: libstdc++/5625: exception unwinding creates invalid pointer o n mips Date: 23 Apr 2002 13:53:31 -0700 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