comp.lang.ada
 help / color / mirror / Atom feed
From: Tero Koskinen <tero.koskinen@iki.fi>
Subject: Re: Feature or Bug?  2#1111# shifted by 4 is 224
Date: Wed, 4 Jun 2008 06:36:24 +0300
Date: 2008-06-04T06:36:24+03:00	[thread overview]
Message-ID: <20080604063624.7f1ad6c7.tero.koskinen@iki.fi> (raw)
In-Reply-To: 873anvk9a2.fsf@ludovic-brenta.org

On Mon, 02 Jun 2008 19:59:33 +0200 Ludovic Brenta wrote:
> Tero Koskinen <tero.koskinen@iki.fi> writes:
> > On Mon, 02 Jun 2008 17:17:19 +0200 Dennis Hoppe wrote:
> >> In Example B, we limit the parameter N to Positive, because we do not 
> >> want "negative" shifts. The result of Shift_Left(2#1111#, 4) is 224
> >> (2#11100000#) !
> >
> > type Modular_Type is mod 2**4;
> > function Shift_Left (Item : in Modular_Type;
> >                      N    : in Positive) return Modular_Type is
> > begin
> >    return Item * (2**N);
> > end Shift_Left;
> 
> This looks like http://gcc.gnu.org/PR30740 which is fixed in Debian
> unstable :)
> 
> Could you confirm that this is the same bug indeed?

Applying org.debian.gcc-4.3/debian/patches/pr30740.dpatch (from
ada-france.org server) solves the problem for me (GCC 4.3.0,
OpenBSD/i386 as earlier). On Solaris the compiler used -gnato and
-fstack-check flags by default, so the bug didn't occur there.

-- 
Tero Koskinen - http://iki.fi/tero.koskinen/



  parent reply	other threads:[~2008-06-04  3:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-02 15:17 Feature or Bug? 2#1111# shifted by 4 is 224 Dennis Hoppe
2008-06-02 16:11 ` Tero Koskinen
2008-06-02 17:59   ` Ludovic Brenta
2008-06-02 18:52     ` Dennis Hoppe
2008-06-03  0:51       ` Jeffrey R. Carter
2008-06-03  4:26         ` Gautier
2008-06-03 19:36           ` Jeffrey R. Carter
2008-06-03 17:56         ` Adam Beneschan
2008-06-03 19:39           ` Jeffrey R. Carter
2008-06-03  8:10       ` Ludovic Brenta
2008-06-03 12:59       ` Samuel Tardieu
2008-06-04  3:36     ` Tero Koskinen [this message]
2008-06-02 22:32 ` Gautier
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox