--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: libgnat-3.15p-1: Strings.Maps.Is_Subset always returns False
- From: ludovic.brenta@insalien.org
- Date: Mon, 02 Feb 2004 17:50:16 +0100
- Message-id: <E1AnhH6-00029W-Jf@smtp-out.tiscali.be>
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 ---