Bug 15802 - ICE at expr.c:6764 (placeholder mechanism)
Summary: ICE at expr.c:6764 (placeholder mechanism)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 4.2.0
Assignee: Eric Botcazou
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code
Depends on:
Blocks: 15806
  Show dependency treegraph
 
Reported: 2004-06-03 19:12 UTC by Ludovic Brenta
Modified: 2006-09-15 18:37 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-03-19 06:38:09


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ludovic Brenta 2004-06-03 19:12:59 UTC
(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
Comment 1 Andrew Pinski 2004-10-12 03:59:08 UTC
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).                   |
+==============================================================
============+
Comment 2 Andrew Pinski 2006-03-19 06:00:35 UTC
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>
Comment 3 Eric Botcazou 2006-03-19 06:38:09 UTC
Very old problem.  I've a patch in the works.
Comment 4 Eric Botcazou 2006-09-15 18:32:36 UTC
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

Comment 5 Eric Botcazou 2006-09-15 18:37:33 UTC
Fixed on mainline.