Bug 20596 - Bug Box, combination of Ada 2005, dotted notation, Hash_Maps, and Unbounded_String
Summary: Bug Box, combination of Ada 2005, dotted notation, Hash_Maps, and Unbounded_S...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-03-23 02:42 UTC by Georg Bauhaus
Modified: 2005-09-06 13:32 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2005-06-20 19:28:31


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Bauhaus 2005-03-23 02:42:08 UTC
GNATMAKE 4.1.0 20050321 (experimental)
Copyright 1995-2004 Free Software Foundation, Inc.
  "uex.ali" being checked ...
  -> "exmpl.ads" time stamp mismatch
gcc -c -gnat05 uex.adb
+===========================GNAT BUG DETECTED==============================+
| 4.1.0 20050321 (experimental) (i686-pc-linux-gnu) Storage_Error stack overflow
(or erroneous memory access)|
| Error detected at uex.adb:9:15                                           |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+

Please include these source files with error report
Note that list may not be accurate in some cases, 
so please double check that the problem can still 
be reproduced with the set of files listed.

uex.adb
exmpl.ads

compilation abandoned
End of compilation
gnatmake: "uex.adb" compilation error

Not using dotted notation does not trigger.
Using Natural in place of Unbounded_String works, too.

Supplying an alternate Hash function does _not_ prevent
the box.

GCC 4.0 displays the box, too.


with Ada.Strings.Unbounded;  use Ada.Strings.Unbounded;
with Exmpl;

procedure uex is
   use Exmpl.US_Lookup_Tables;

   hm: Map;
begin
   hm.include(To_Unbounded_String("key"), To_Unbounded_String("value"));
   --include(hm, To_Unbounded_String("key"), To_Unbounded_String("value"));
end uex;


with Ada.Containers.Hashed_Maps;
with Ada.Strings.Unbounded, Ada.Strings.Unbounded.Hash;

package Exmpl is

   use Ada.Strings.Unbounded;

   package US_Lookup_Tables is
      new Ada.Containers.Hashed_Maps (Unbounded_String,
                                      Unbounded_String,
                                      Equivalent_Keys => "=",
                                      Hash => Hash);


end Exmpl;
Comment 1 Laurent GUERBY 2005-03-23 11:55:18 UTC
Could you try the patch from PR ada/20593 and report?
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20593

Comment 2 Georg Bauhaus 2005-03-24 13:18:03 UTC
Subject: Re:  Bug Box, combination of Ada 2005, dotted notation,
 Hash_Maps, and Unbounded_String

laurent at guerby dot net wrote:

>------- Additional Comments From laurent at guerby dot net  2005-03-23 11:55 -------
>Could you try the patch from PR ada/20593 and report?
>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20593
>
>
>
>  
>
just patching varasm.c and rerunning make
still has the same result. I'll try a fresh compiler.

--
Georg

Comment 3 Laurent GUERBY 2005-03-24 21:00:41 UTC
This was a wild guess, the problem is probably elsewhere. On x86_64 I get a
slightly more explicit location:

$ gcc -c -gnat05 uex.adb
===========================GNAT BUG DETECTED==============================+
| 4.1.0 20050324 (experimental) (x86_64-unknown-linux-gnu) Program_Error
sem_type.adb:1587 explicit raise|
| Error detected at uex.adb:9:15                                           |
Comment 4 Arnaud Charlet 2005-09-06 13:32:30 UTC
Now works fine on mainline.

Arno