public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* RE: libstdc++/5625: exception unwinding creates invalid pointer o n mips
@ 2002-04-23 12:36 Ed Maste
0 siblings, 0 replies; 6+ messages in thread
From: Ed Maste @ 2002-04-23 12:36 UTC (permalink / raw)
To: echristo; +Cc: gcc-prs
The following reply was made to PR libstdc++/5625; it has been noted by GNATS.
From: Ed Maste <emaste@SANDVINE.com>
To: "'echristo@gcc.gnu.org'" <echristo@gcc.gnu.org>,
"'echristo@redhat.com'" <echristo@redhat.com>, Ed Maste
<emaste@SANDVINE.com>, "'gcc-bugs@gcc.gnu.org'" <gcc-bugs@gcc.gnu.org>,
"'gcc-prs@gcc.gnu.org'" <gcc-prs@gcc.gnu.org>, "'gcc-gnats@gcc.gnu.org'"
<gcc-gnats@gcc.gnu.org>
Cc:
Subject: RE: libstdc++/5625: exception unwinding creates invalid pointer o
n mips
Date: Tue, 23 Apr 2002 15:35:33 -0400
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.
And then, on page 2:
1.2.1 UNPREDICTABLE
UNPREDICTABLE results may vary from processor
implementation to implementation, instruction
to instruction, or as a function of time on the
same implementation or instruction. Software can
never depend on results that are UNPREDICTABLE.
UNPREDICTABLE operations may cause a result to
be generated or not. If a result is generated,
it is UNPREDICTABLE. UNPREDICTABLE operations
may cause arbitrary exceptions.
-ed
http://www.mips.com/publications/documentation/MD00087-2B-MIPS64BIS-AFP-00.9
5.pdf
(no comma attached to the end of the URL this time!)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: libstdc++/5625: exception unwinding creates invalid pointer o n mips
@ 2002-05-01 10:36 cgd
0 siblings, 0 replies; 6+ messages in thread
From: cgd @ 2002-05-01 10:36 UTC (permalink / raw)
To: echristo; +Cc: gcc-prs
The following reply was made to PR libstdc++/5625; it has been noted by GNATS.
From: cgd@broadcom.com
To: echristo@redhat.com,
"'gcc-bugs@gcc.gnu.org'" <gcc-bugs@gcc.gnu.org>,
"'gcc-prs@gcc.gnu.org'" <gcc-prs@gcc.gnu.org>,
"'gcc-gnats@gcc.gnu.org'" <gcc-gnats@gcc.gnu.org>
Cc:
Subject: Re: libstdc++/5625: exception unwinding creates invalid pointer
o n mips
Date: 01 May 2002 10:29:36 -0700
FYI, I just checked in a change to the mips64 gdb simulator code so
that it will do checking of values (for many, but certainly not all
8-) which are allowed to produce UNPREDICTABLE results.
This causes 27 gcc (g++, actually) tests which previously passed to
fail, due to UNPREDICTABLE behaviour:
FAIL: g++.dg/eh/registers1.C execution test
FAIL: g++.dg/eh/unexpected1.C execution test
FAIL: g++.brendan/eh1.C Execution test
FAIL: g++.eh/flow1.C Execution test
FAIL: g++.eh/fntry1.C Execution test
FAIL: g++.eh/ia64-1.C Execution test
FAIL: g++.eh/inline2.C Execution test
FAIL: g++.eh/pdel2.C Execution test
FAIL: g++.eh/spec2.C Execution test
FAIL: g++.eh/spec3.C Execution test
FAIL: g++.eh/spec4.C Execution test
FAIL: g++.eh/tmpl1.C Execution test
FAIL: g++.mike/eh16.C Execution test
FAIL: g++.mike/eh17.C Execution test
FAIL: g++.mike/eh33.C Execution test
FAIL: g++.mike/eh39.C Execution test
FAIL: g++.mike/eh40.C Execution test
FAIL: g++.mike/eh49.C Execution test
FAIL: g++.mike/eh50.C Execution test
FAIL: g++.mike/eh51.C Execution test
FAIL: g++.mike/eh6.C Execution test
FAIL: g++.other/eh3.C Execution test
FAIL: g++.other/singleton.C Execution test
FAIL: g++.other/vbase2.C Execution test
FAIL: g++.pt/fntry1.C Execution test
FAIL: g++.robertl/eb66.C Execution test
FAIL: g++.robertl/eb88.C Execution test
chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: libstdc++/5625: exception unwinding creates invalid pointer o n mips
@ 2002-04-24 12:46 Ed Maste
0 siblings, 0 replies; 6+ messages in thread
From: Ed Maste @ 2002-04-24 12:46 UTC (permalink / raw)
To: echristo; +Cc: gcc-prs
The following reply was made to PR libstdc++/5625; it has been noted by GNATS.
From: Ed Maste <emaste@SANDVINE.com>
To: "'cgd@broadcom.com'" <cgd@broadcom.com>, echristo@redhat.com
Cc: Ed Maste <emaste@SANDVINE.com>, "'echristo@gcc.gnu.org'"
<echristo@gcc.gnu.org>, "'gcc-bugs@gcc.gnu.org'" <gcc-bugs@gcc.gnu.org>,
"'gcc-prs@gcc.gnu.org'" <gcc-prs@gcc.gnu.org>, "'gcc-gnats@gcc.gnu.org'"
<gcc-gnats@gcc.gnu.org>
Subject: RE: libstdc++/5625: exception unwinding creates invalid pointer o
n mips
Date: Wed, 24 Apr 2002 15:41:27 -0400
> > If _Unwind_Ptr were signed, the right thing should happen. (iirc; i
> > seem to recall having discussed this with Ed previously [and him
> > having confirmed that result, but I may be mistaken].)
That is correct.
When I discovered the issue I wanted to change as little as possible
to isolate it so I left the _Unwind_Ptr typedef alone and rebuilt just
eh_personality.
-ed
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: libstdc++/5625: exception unwinding creates invalid pointer o n mips
@ 2002-04-23 16:16 cgd
0 siblings, 0 replies; 6+ messages in thread
From: cgd @ 2002-04-23 16:16 UTC (permalink / raw)
To: echristo; +Cc: gcc-prs
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" <emaste@sandvine.com>,
"'echristo@gcc.gnu.org'" <echristo@gcc.gnu.org>,
"'gcc-bugs@gcc.gnu.org'" <gcc-bugs@gcc.gnu.org>,
"'gcc-prs@gcc.gnu.org'" <gcc-prs@gcc.gnu.org>,
"'gcc-gnats@gcc.gnu.org'" <gcc-gnats@gcc.gnu.org>
Subject: Re: libstdc++/5625: exception unwinding creates invalid pointer
o n mips
Date: 23 Apr 2002 16:07:19 -0700
Eric asked me a further question off-list, and I responded:
> [I believe] The problem is that:
>
> typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
>
> So the cast to _Unwind_Ptr makes the 32-bit result unsigned, and the
> promotion to the 64-bit _Unwind_Word happens therefore to zero extend,
> rather than sign extend.
>
> If _Unwind_Ptr were signed, the right thing should happen. (iirc; i
> seem to recall having discussed this with Ed previously [and him
> having confirmed that result, but I may be mistaken].)
chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: libstdc++/5625: exception unwinding creates invalid pointer o n mips
@ 2002-04-23 13:56 cgd
0 siblings, 0 replies; 6+ messages in thread
From: cgd @ 2002-04-23 13:56 UTC (permalink / raw)
To: echristo; +Cc: gcc-prs
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" <emaste@sandvine.com>,
"'echristo@gcc.gnu.org'" <echristo@gcc.gnu.org>,
"'gcc-bugs@gcc.gnu.org'" <gcc-bugs@gcc.gnu.org>,
"'gcc-prs@gcc.gnu.org'" <gcc-prs@gcc.gnu.org>,
"'gcc-gnats@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
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: libstdc++/5625: exception unwinding creates invalid pointer o n mips
@ 2002-04-23 12:56 Eric Christopher
0 siblings, 0 replies; 6+ messages in thread
From: Eric Christopher @ 2002-04-23 12:56 UTC (permalink / raw)
To: echristo; +Cc: gcc-prs
The following reply was made to PR libstdc++/5625; it has been noted by GNATS.
From: Eric Christopher <echristo@redhat.com>
To: Ed Maste <emaste@SANDVINE.com>
Cc: "'echristo@gcc.gnu.org'" <echristo@gcc.gnu.org>,
"'gcc-bugs@gcc.gnu.org'"
<gcc-bugs@gcc.gnu.org>,
"'gcc-prs@gcc.gnu.org'" <gcc-prs@gcc.gnu.org>,
"'gcc-gnats@gcc.gnu.org'"
<gcc-gnats@gcc.gnu.org>
Subject: RE: libstdc++/5625: exception unwinding creates invalid pointer o n
mips
Date: 23 Apr 2002 12:44:46 -0700
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.
I'll take a look at the sign extension requirements in the back end.
-eric
--
A fire drill does not demand
a fire.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-05-01 17:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-23 12:36 libstdc++/5625: exception unwinding creates invalid pointer o n mips Ed Maste
2002-04-23 12:56 Eric Christopher
2002-04-23 13:56 cgd
2002-04-23 16:16 cgd
2002-04-24 12:46 Ed Maste
2002-05-01 10:36 cgd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).