The following bug box is generated with the attched test case: +===========================GNAT BUG DETECTED==============================+ | 4.0.1 (i686-pc-linux-gnu) in create_tmp_var, at gimplify.c:368 | | Error detected at message_pool.adb:62:5 | | Please submit a bug report; see http://gcc.gnu.org/bugs.html. | | 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). | +==========================================================================+ Using built-in specs. 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. message_pool.adb message_pool.ads compilation abandoned gnatmake: "message_pool.adb" compilation error gcc version: Target: i686-pc-linux-gnu Configured with: /home/scott/gcc-4.0.1/gcc-4.0.1/configure --prefix=/usr/local/gcc-4.0.1 --enable-languages=c,c++,ada Thread model: posix gcc version 4.0.1 command line: /usr/local/gcc-4.0.1/bin/gnatmake -gnat05 message_pool.adb gcc -c -gnat05 message_pool.adb The code attached is reduce set of the code which originally uncovered the problem. I have noticed that removing the Temp_Key variable allows the code to compile without error or warning. In my original code this variable was necessary, in the test case it is only there to demonstrate the failure.
Created attachment 10071 [details] Ada spec for the test case
Created attachment 10072 [details] Ada body for the test case
On the mainline on x86_64 I get: +===========================GNAT BUG DETECTED==============================+ | 4.1.0 20051031 (experimental) (x86_64-unknown-linux-gnu) GCC error: | | in tree_low_cst, at tree.c:4386 | | Error detected at message_pool.adb:64:5 | | 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). | +==========================================================================+
The mainline issue looks like PR 23427.
Confirmed on 4.0.2 and trunk. +===========================GNAT BUG DETECTED==============================+ | 4.0.2 (i686-pc-linux-gnu) in tree_low_cst, at tree.c:3850 | | Error detected at message_pool.adb:63:5 | +===========================GNAT BUG DETECTED==============================+ | 4.1.0 20051102 (experimental) (i686-pc-linux-gnu) GCC error: | | in tree_low_cst, at tree.c:4386 | | Error detected at message_pool.adb:63:5 |
Fixed on trunk