Bug 16212 - ICE ada/gcc-interface/trans.c:1626 on legal Ada 83 program
Summary: ICE ada/gcc-interface/trans.c:1626 on legal Ada 83 program
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 3.4.0
: P5 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-06-25 22:22 UTC by Ludovic Brenta
Modified: 2015-01-03 05:28 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-11-17 19:59:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludovic Brenta 2004-06-25 22:22:30 UTC
pragma Ada_83;
procedure Test_251265(x: integer) is
begin
   case x is
      when integer'last +1 => null;
      when 0               => null; -- line 5
      when others          => null;
   end case;
end Test_251265;

$ gnatmake -q -O1 test_251265
+===========================GNAT BUG DETECTED==============================+
| 3.15p  (20020523) (i486-pc-linux-gnu) Gigi abort, Code=316               |
| Error detected at test_251265.adb:4:9                                    |
| Please submit bug report by email to report@gnat.com.                    |
| Use a subject line meaningful to you and us to track the bug.            |
| (include your customer number #nnn in the subject line).                 |
| Include the entire contents of this bug box in the report.               |
| Include the exact gnatgcc or gnatmake command that you entered.          |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
| (use plain ASCII or MIME attachment, or FTP to your customer directory). |
| See README.GNATPRO for full info on procedure for submitting bugs.       |
+==========================================================================+

Please include these source files with error report

test_251265.adb

compilation abandoned
gnatmake: "test_251265.adb" compilation error
Comment 1 Ludovic Brenta 2004-06-25 22:33:39 UTC
Sorry, it's late.  Here is the error message from 3.4:

+===========================GNAT BUG DETECTED==============================+
| 3.4.0 (Debian) (i486-pc-linux-gnu) Gigi abort, Code=316                  |
| Error detected at test_251265.adb:4:9                                    |
| 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-3.4 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.

test_251265.adb

compilation abandoned
gnatmake: "test_251265.adb" compilation error
Comment 2 Andrew Pinski 2004-10-12 22:00:42 UTC
Confirmed on the mainline:
+===========================GNAT BUG 
DETECTED==============================+
| 4.0.0 20041012 (experimental) (powerpc-apple-darwin7.4.1) GCC error:     |
| in Case_Statement_to_gnu, at /ada/trans.c:1189                           |
| Error detected at test_251265.adb:4:9                                    |
| 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).                   |
+==============================================================
============+
Comment 3 Samuel Tardieu 2008-11-17 19:59:49 UTC
Lowering priority: opened more than 4 years ago, concerns Ada 83, pathological case.

+===========================GNAT BUG DETECTED==============================+
| 4.4.0 20081021 (experimental) (x86_64-unknown-linux-gnu) GCC error:      |
| in Case_Statement_to_gnu, at ada/gcc-interface/trans.c:1626              |
| Error detected at test_251265.adb:4:9                                    |
Comment 4 Nicolas Boulenguez 2011-08-31 11:52:16 UTC
found 4.6.1
Comment 5 Nicolas Boulenguez 2014-02-27 18:42:15 UTC
4.9.0 20140218 (experimental) [trunk rev 207856] (x86_64-linux-gnu) GCC error:
in Case_Statement_to_gnu, at ada/gcc-interface/trans.c:2345
Error detected at test_106.adb:4:9
Comment 6 Alexandre Oliva 2015-01-03 05:28:38 UTC
This is fixed in the trunk.  It says:

$ ./xgcc -B./ -Iada/rts/ -c -O1 /l/tmp/build/gcc/trunk/obj-x86_64-linux-gnu/gcc/test_251265.adb
test_251265.adb:5:12: choice given in case statement is not static
test_251265.adb:5:25: warning: value not in range of type "Standard.Integer"
test_251265.adb:5:25: warning: "Constraint_Error" will be raised at run time
test_251265.adb:5:25: expression raises exception, cannot be static (RM 4.9(34))
$ ./xgcc --version
xgcc (GCC) 5.0.0 20150102 (experimental) [trunk revision ae61c50:a5fe274:4df12aa29efd9950b5bcbe15c207e61e11c16435]