* Bug in GCC ?
@ 2008-05-19 15:50 Sébastien
2008-05-19 15:57 ` Matthew Heaney
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Sébastien @ 2008-05-19 15:50 UTC (permalink / raw)
He is the sample code I'm trying to compile:
with Ada.Containers.Hashed_Maps;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Strings.Unbounded.Hash;
package SCMAL.Tools.HashedMaps is
package HashedStrStr is
new Ada.Containers.Hashed_Maps(
Key_Type => Unbounded_String,
Element_Type => Unbounded_String,
Hash => Ada.Strings.Unbounded.Hash,
Equivalent_Keys => "=");
end SCMAL.Tools.HashedMaps;
At compile time:
$ gnatmake -Pgentest -cargs -gnatn
gcc-4.1 -c -gnat05 -g3 -O2 -gnatn -I- -gnatA
/var/local/mscm/ada/tests/generic/scmal-tools-hashedmaps.ads
+===========================GNAT BUG DETECTED==============================+
| 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu3)
(i486-pc-linux-gnu) GCC error:|
| in referenced_var_lookup, at tree-dfa.c:578 |
| No source file position information available |
| 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-4.1 or gnatmake command that you entered. |
| Also include sources listed below in gnatchop format |
| (concatenated together with no headers between files). |
+==========================================================================+
It works fine if I remove the -gnatn and -O2
Sebastien
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bug in GCC ?
2008-05-19 15:50 Bug in GCC ? Sébastien
@ 2008-05-19 15:57 ` Matthew Heaney
2008-05-19 16:47 ` Sébastien
2008-05-19 17:41 ` Samuel Tardieu
2008-05-19 18:29 ` Ludovic Brenta
2 siblings, 1 reply; 7+ messages in thread
From: Matthew Heaney @ 2008-05-19 15:57 UTC (permalink / raw)
On May 19, 11:50 am, Sébastien <seb.mor...@gmail.com> wrote:
>
> with Ada.Containers.Hashed_Maps;
Why didn't you use the indefinite form? That would allow you to ditch
the Unbounded_String.
with Ada.Containers.Indefinite_Hashed_Maps;
pragma Elaborate_All (Ada.Containers.Indefinite_Hashed_Maps);
package SCMAL.Tools.HashedMaps is
package HashedStrStr is
new Ada.Containers.Indefinite_Hashed_Maps(
Key_Type => String,
Element_Type => String,
Hash => Ada.Strings.Hash,
Equivalent_Keys => "=");
end SCMAL.Tools.HashedMaps;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bug in GCC ?
2008-05-19 15:50 Bug in GCC ? Sébastien
2008-05-19 15:57 ` Matthew Heaney
@ 2008-05-19 17:41 ` Samuel Tardieu
2008-05-19 18:29 ` Ludovic Brenta
2 siblings, 0 replies; 7+ messages in thread
From: Samuel Tardieu @ 2008-05-19 17:41 UTC (permalink / raw)
Note that GCC 4.1 is quite old, newer GCC do not have this bug.
Sam
--
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Bug in GCC ?
2008-05-19 15:50 Bug in GCC ? Sébastien
2008-05-19 15:57 ` Matthew Heaney
2008-05-19 17:41 ` Samuel Tardieu
@ 2008-05-19 18:29 ` Ludovic Brenta
2008-05-19 19:32 ` Sebastien Morand
2 siblings, 1 reply; 7+ messages in thread
From: Ludovic Brenta @ 2008-05-19 18:29 UTC (permalink / raw)
Sébastien <seb.morand@gmail.com> writes:
> $ gnatmake -Pgentest -cargs -gnatn
> gcc-4.1 -c -gnat05 -g3 -O2 -gnatn -I- -gnatA
> /var/local/mscm/ada/tests/generic/scmal-tools-hashedmaps.ads
> +===========================GNAT BUG DETECTED==============================+
> | 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu3)
> (i486-pc-linux-gnu) GCC error:|
> | in referenced_var_lookup, at tree-dfa.c:578 |
[...]
> It works fine if I remove the -gnatn and -O2
This is a known bug: http://gcc.gnu.org/PR22280
It is fixed in 4.2 and later.
--
Ludovic Brenta.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-05-19 21:56 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-19 15:50 Bug in GCC ? Sébastien
2008-05-19 15:57 ` Matthew Heaney
2008-05-19 16:47 ` Sébastien
2008-05-19 17:41 ` Samuel Tardieu
2008-05-19 18:29 ` Ludovic Brenta
2008-05-19 19:32 ` Sebastien Morand
2008-05-19 21:56 ` Ludovic Brenta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox