[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#230809: marked as done (libgnat-3.15p-1: Strings.Maps.Is_Subset always returns False)



Your message dated Fri, 08 Dec 2006 13:20:41 +0100
with message-id <87slfqa89y.fsf@ludovic-brenta.org>
and subject line Fixed in GCC 4.1
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: gnat
Version: 3.15p-5
Severity: normal

(Arnaud and Pascal, I have CC'd you because I found your email thread
in the archives of the AWS mailing list.  It seems you and I found
this bug independently.)

The following program always prints "false" when the expected result
is "true".

with Ada.Text_IO;
with Ada.Strings.Maps; use Ada.Strings.Maps;
with Ada.Strings.Maps.Constants;
procedure Test is
   Set : Character_Set;
begin
   Set := To_Set ("8080");
   if Is_Subset (Set, Constants.Decimal_Digit_Set) then
      Ada.Text_IO.Put_Line ("true");
   else
      Ada.Text_IO.Put_Line ("false");
   end if;
end Test;

The problem is in Strings.Maps.Is_Subset, which is implemented as
follows:

   function Is_Subset
     (Elements : Character_Set;
      Set      : Character_Set)
      return     Boolean
   is
   begin
      return (Elements and Set) = Elements;
   end Is_Subset;


where Character_Set is a packed array (Character) of Boolean, i.e. a
256-bit bit field.  The relevant file (a-strmap.adb) seems to have
been miscompiled.  I have confirmed that this bug is specific to
Debian; the binary distribution from ACT does not have it.  Here are
the relevant portions of my build log for gnat 3.15p-5:

(when building the static library:)

../../xgcc -B../../ -c -g -O2 -gnatn -DNEED_CONVERT_ADDRESSES  -gnatpg -I. -I.. -I/home/lbrenta/src/debian/gnat-3.15p/ada a-strmap.adb 

(when building the shared library:)

../../xgcc -B../../ -c -g -O2 -gnatn -DNEED_CONVERT_ADDRESSES -fPIC  -gnatpg -I. -I.. -I/home/lbrenta/src/debian/gnat-3.15p/ada a-strmap.adb 


Pascal, is it possible for you to tell me which options were used to
compile this file in ACT's binary distribution?  I'm talking about
3.15p which is a bit old now.  I suspect that -gnatn is triggering a
bug in gnat, which then miscompiles the file.  I could send you the
assembler output if you want.

-- 
Ludovic Brenta.

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux lbrenta 2.4.23-1-686-smp #1 SMP Sun Nov 30 21:55:37 EST 2003 i686
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8

Versions of packages gnat depends on:
ii  libgnat-3.15p-1             3.15p-5      The GNU Ada 95 compiler runtime li
ii  libc6                       2.3.2.ds1-11 GNU C Library: Shared libraries an

-- no debconf information



--- End Message ---
--- Begin Message ---
Version: 4.1.0-2

GCC 4.1 fixes this bug.

-- 
Ludovic Brenta.


--- End Message ---

Reply to: