This happens on x86 but not on x86_64, 6 ACATS test have the following ICE: +===========================GNAT BUG DETECTED==============================+ | 4.0.0 20041122 (experimental) (i686-pc-linux-gnu) GCC error: | | in generate_element_copy, at tree-sra.c:1507 | | Error detected at c32001e.adb:253:5 | c32001e c52011a c64105b c95086b cd2b11a cd2b11b
Confirmed, also fails on ppc-darwin.
This might be fixed by: http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02030.html But since I have not tried it yet and it looks like the build is broken, I don't know.
These 6 ACATS FAIL appeared between 20041027 13:16:33 CET and 20041107 12:23:42 CET (together with 21 additional ACATS FAIL...).
Also fails the same way for the same tests on ia64-linux.
This test PASS at -O0 on x86, x86_64 and ia64.
Removing the target milestone as per <http://gcc.gnu.org/ml/gcc/2005-01/msg01255.html> as this is only known to happen in Ada.
Reconfirmed, reduced testcase from c32001e: PROCEDURE C32001E IS BEGIN DECLARE PACKAGE PKG1 IS TYPE PACC IS PRIVATE; FUNCTION INIT5 (I : INTEGER) RETURN PACC; PROCEDURE CHECK5 (V : PACC; S : STRING); PRIVATE TYPE VECTOR IS ARRAY (NATURAL RANGE <>) OF INTEGER; TYPE PACC IS ACCESS VECTOR; END PKG1; PACKAGE BODY PKG1 IS FUNCTION INIT5 (I : INTEGER) RETURN PACC IS ACCV : PACC := NEW VECTOR'(1 .. 0 => 0); BEGIN RETURN ACCV; END INIT5; PROCEDURE CHECK5 (V : PACC; S : STRING) IS BEGIN NULL; END CHECK5; END PKG1; USE PKG1; V1, V2 : PACC := INIT5 (9); BEGIN NULL; END; END C32001E; This still looks like a front-end bug because any slight removal of code it will not ICE.
SRA is an Ada killer because of the the abuse of VIEW_CONVERT_EXPRs by the Ada front-end. I think it should be disabled in the Ada compiler for 4.0.x.
Subject: Re: [4.0 Regression] ACATS ICE in bug in tree-sra.c:1507 on x86 and ppc-darwin (6 FAIL) > SRA is an Ada killer because of the the abuse of VIEW_CONVERT_EXPRs by the Ada > front-end. I think it should be disabled in the Ada compiler for 4.0.x. Sounds reasonable to me. Arno
> > SRA is an Ada killer because of the the abuse of VIEW_CONVERT_EXPRs by the Ada > > front-end. I think it should be disabled in the Ada compiler for 4.0.x. > > Sounds reasonable to me. OK, I'll submit a patch once 4.0.x is branched. As of today, excluding the problematic cxa3004 and cxb3006, as well as cxa4006 and cxa4017 for which I've submitted a fix, we have 6 failures at -O2 -fno-tree-sra.
I confirm all six ACATS tests PASS with -O2 -fno-tree-sra on x86-linux.
Fails on sparc-linux as well. Any resolution on this now that the release is near? With PR18819 these are the cause of the x86 ACATS regressions (3.4 was ACATS failure free on x86).
Subject: Bug 18659 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: ebotcazou@gcc.gnu.org 2005-04-07 06:51:30 Modified files: gcc : ChangeLog gcc/doc : invoke.texi gcc/ada : ChangeLog misc.c Log message: PR ada/18659 PR ada/18819 ada/ * misc.c (tree_sra_requested): New global. (gnat_init_options): Detect -ftree-sra. (gnat_post_options): Enable Tree-SRA only if specifically requested. gcc/ * doc/invoke.texi (Optimize Options): Document that -ftree-sra is not automatically enabled for the Ada compiler. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.144&r2=2.7592.2.145 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/invoke.texi.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.583.2.9&r2=1.583.2.10 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.638.4.10&r2=1.638.4.11 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/misc.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.96.6.1&r2=1.96.6.2
It only fails on mainline now.
Still present on x86-linux as of LAST_UPDATED: Sat Jun 18 09:02:59 UTC 2005
Between: LAST_UPDATED: Sat Jul 2 09:40:45 UTC 2005 LAST_UPDATED: Wed Jul 6 23:57:55 UTC 2005 c52011a cd2b11a cd2b11b started passing instead of ICEing. c32001e c64105b c95086b are still ICEing in generate_element_copy, at tree-sra.c:1574
Ada is not release-critical.
*** Bug 24896 has been marked as a duplicate of this bug. ***
Investigating.
Created attachment 10332 [details] Reduced testcase. Compile at -O on x86.
Subject: Bug 18659 Author: ebotcazou Date: Thu Dec 15 13:29:14 2005 New Revision: 108576 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108576 Log: 2005-12-15 Eric Botcazou <ebotcazou@adacore.com> PR ada/18659 PR ada/18819 ada/ * misc.c (tree_sra_requested): New global. (gnat_init_options): Detect -ftree-sra. (gnat_post_options): Enable Tree-SRA only if specifically requested. gcc/ * doc/invoke.texi (Optimize Options): Document that -ftree-sra is not automatically enabled for the Ada compiler. Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/ada/ChangeLog branches/gcc-4_1-branch/gcc/ada/misc.c branches/gcc-4_1-branch/gcc/doc/invoke.texi
On mainline as of 20060111, the three ACATS ICE are present when cross compiling from x86-linux to sparc-rtems4.7.
Working on it again.
Subject: Bug 18659 Author: charlet Date: Wed Feb 15 09:31:40 2006 New Revision: 111030 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111030 Log: 2006-02-13 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Olivier Hainque <hainque@adacore.com> Eric Botcazou <ebotcazou@adacore.com> * ada-tree.h: (TYPE_UNCHECKED_UNION_P): Deleted. * gigi.h (value_factor_p): Add prototype and description, now public. * decl.c (gnat_to_gnu_field): Don't attempt BLKmode to integral type promotion for field with rep clause if the associated size was proven to be in error. Expand comments describing attempts to use a packable type. (gnat_to_gnu_entity) <E_Signed_Integer_Subtype, E_Floating_Point_Subtype>: Inherit alias set of what we are making a subtype of to ensure conflicts amongst all subtypes in a hierarchy, necessary since these are not different types and pointers may actually designate any subtype in this hierarchy. (gnat_to_gnu_entity, case E_Record_Type): Always make fields for discriminants but put them into record only if not Unchecked_Union; pass flag to components_to_record showing Unchecked_Union. (make_dummy_type): Use UNION_TYPE only if Unchecked_Union and no components before variants; don't set TYPE_UNCHECKED_UNION_P. (components_to_record): New argument UNCHECKED_UNION. Remove special case code for Unchecked_Union and instead use main code with small changes. PR ada/26096 (gnat_to_gnu_entity) <E_Variable>: Do not initialize the aligning variable with the expression being built, only its inner field. * trans.c (Handled_Sequence_Of_Statements_to_gnu): Remove call to emit_sequence_entry_statements. (emit_sequence_entry_statements, body_with_handlers_p): Delete. (establish_gnat_vms_condition_handler): Move before Subprogram_Body_to_gnu. (Subprogram_Body_to_gnu): On VMS, establish_gnat_vms_condition_handler for a subprogram if it has a foreign convention or is exported. (Identifier_to_gnu): Manually unshare the DECL_INITIAL tree when it is substituted for a CONST_DECL. (tree_transform, case N_Aggregate): Remove code for UNION_TYPE and pass Etype to assoc_to_constructor. (assoc_to_constructor): New argument, GNAT_ENTITY; use it to ignore discriminants of Unchecked_Union. (TARGET_ABI_OPEN_VMS): Define to 0 if not defined, so that later uses don't need cluttering preprocessor directives. (establish_gnat_vms_condition_handler): New function. Establish the GNAT condition handler as current in the compiled function. (body_with_handlers_p): New function. Tell whether a given sequence of statements node is attached to a package or subprogram body and involves exception handlers possibly nested within inner block statements. (emit_sequence_entry_statements): New function, to emit special statements on entry of sequences when necessary. Establish GNAT condition handler in the proper cases for VMS. (Handled_Sequence_Of_Statements_to_gnu): Start block code with emit_sequence_entry_statements. * utils2.c (find_common_type): If both input types are BLKmode and have a constant size, use the smaller one. (build_simple_component_ref): Also match if FIELD and NEW_FIELD are the same. * utils.c (value_factor_p): Make public, to allow uses from other gigi units. (create_type_decl): Do not set the flag DECL_IGNORED_P for dummy types. (convert, case UNION_TYPE): Remove special treatment for unchecked unions. PR ada/18659 (update_pointer_to): Update variants of pointer types to unconstrained arrays by attaching the list of fields of the main variant. Modified: trunk/gcc/ada/ada-tree.h trunk/gcc/ada/decl.c trunk/gcc/ada/gigi.h trunk/gcc/ada/trans.c trunk/gcc/ada/utils.c trunk/gcc/ada/utils2.c
The fix is almost miraculous. :-)