From patchwork Sat Dec 8 11:53:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Ada] Fix ICE with overaligned vectors on IA-64 From: Eric Botcazou X-Patchwork-Id: 204645 Message-Id: <8138066.FpU4VBegYZ@polaris> To: gcc-patches@gcc.gnu.org Date: Sat, 08 Dec 2012 12:53:56 +0100 This is an internal error on IA-64 with overaligned vector types, i.e. vector types with alignment of 256 bits. Because this alignment is larger than the largest required alignment, the testcase triggers the alignment circuitry in gigi and there is a small hole in it. Tested on x86_64-suse-linux, applied on the mainline. 2012-12-08 Eric Botcazou * gcc-interface/trans.c (Subprogram_Body_to_gnu): Be prepared for a by-ref VAR_DECL in the case of an Out parameter passed by copy. 2012-12-08 Eric Botcazou * gnat.dg/vect10.ad[sb]: New test. Index: gcc-interface/trans.c =================================================================== --- gcc-interface/trans.c (revision 194319) +++ gcc-interface/trans.c (working copy) @@ -3375,16 +3375,22 @@ Subprogram_Body_to_gnu (Node_Id gnat_nod if (!present_gnu_tree (gnat_param)) { tree gnu_cico_entry = gnu_cico_list; + tree gnu_decl; /* Skip any entries that have been already filled in; they must correspond to In Out parameters. */ while (gnu_cico_entry && TREE_VALUE (gnu_cico_entry)) gnu_cico_entry = TREE_CHAIN (gnu_cico_entry); + /* Do any needed dereferences for by-ref objects. */ + gnu_decl = gnat_to_gnu_entity (gnat_param, NULL_TREE, 1); + gcc_assert (DECL_P (gnu_decl)); + if (DECL_BY_REF_P (gnu_decl)) + gnu_decl = build_unary_op (INDIRECT_REF, NULL_TREE, gnu_decl); + /* Do any needed references for padded types. */ TREE_VALUE (gnu_cico_entry) - = convert (TREE_TYPE (TREE_PURPOSE (gnu_cico_entry)), - gnat_to_gnu_entity (gnat_param, NULL_TREE, 1)); + = convert (TREE_TYPE (TREE_PURPOSE (gnu_cico_entry)), gnu_decl); } } else