This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/30547] New: Never ending program initializing an array of array of Unbounded_String.
- From: "kafka dot fr at laposte dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jan 2007 19:36:29 -0000
- Subject: [Bug ada/30547] New: Never ending program initializing an array of array of Unbounded_String.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following program never ends, after the string has been displayed the
program eats 75% of CPU forever:
--8<-----8<-----8<-----8<-----8<---
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
procedure Bug is
type A_1 is array(1..1) of Unbounded_String;
type A_2 is array(1..1) of A_1;
type Rec is
record
f: A_2 := (others => (others => Null_Unbounded_String));
end record;
var: Rec;
begin
Put_Line("Hello");
end Bug;
--8<-----8<-----8<-----8<-----8<---
The program works fine if the initialization is moved into the procedure's
body:
--8<-----8<-----8<-----8<-----8<---
[...]
type Rec is
record
f: A_2;
end record;
var: Rec;
begin
var.f := (others => (others => Null_Unbounded_String));
[...]
--8<-----8<-----8<-----8<-----8<---
$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --with-tune=i686
--enable-checking=release i486-linux-gnu
Thread model: posix
This problem seems rather old, it has been observed using GNAT 3.15p.
--
Summary: Never ending program initializing an array of array of
Unbounded_String.
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kafka dot fr at laposte dot net
GCC build triplet: i486-linux-gnu
GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30547