(Debian bug #246384) package Test_246384 is type T1(n: natural) is tagged record s1: string (1..n); end record; type T2(j,k: natural) is new T1(j) with record s2: string (1..k); end record; type T3 is new T2 (10, 10) with null record; end Test_246384; +===========================GNAT BUG DETECTED==============================+ | 3.4.0 (Debian) (i486-pc-linux-gnu) in expand_expr_real, at expr.c:6764 | | Error detected at test_246384.ads:8:4 | | 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_246384.ads compilation abandoned gnatmake: "test_246384.ads" compilation error
Confirmed on the mainline with a different error: +===========================GNAT BUG DETECTED==============================+ | 4.0.0 20041008 (experimental) (powerpc-apple-darwin7.4.1) GCC error: | | in gimplify_expr, at /gimplify.c:3917 | | Error detected at test_246384.ads:8:4 | | 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). | +============================================================== ============+
The expression which is causing the ICE is a PLACEHOLDER expression: (gdb) p debug_generic_expr (*expr_p) <PLACEHOLDER_EXPR struct test_246384__t2D.1107>
Very old problem. I've a patch in the works.
Subject: Bug 15802 Author: ebotcazou Date: Fri Sep 15 18:32:24 2006 New Revision: 116981 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116981 Log: PR ada/15802 * decl.c (same_discriminant_p): New static function. (gnat_to_gnu_entity) <E_Record_Type>: When there is a parent subtype and we have discriminants, fix up the COMPONENT_REFs for the discriminants to make them reference the corresponding fields of the parent subtype after it has been built. Added: trunk/gcc/testsuite/gnat.dg/specs/double_record_extension1.ads trunk/gcc/testsuite/gnat.dg/specs/double_record_extension2.ads Modified: trunk/gcc/ada/ChangeLog trunk/gcc/ada/decl.c trunk/gcc/testsuite/ChangeLog
Fixed on mainline.