From patchwork Thu Jul 22 19:13:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 59631 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 260B81007D3 for ; Fri, 23 Jul 2010 05:13:19 +1000 (EST) Received: (qmail 2360 invoked by alias); 22 Jul 2010 19:13:16 -0000 Received: (qmail 2347 invoked by uid 22791); 22 Jul 2010 19:13:15 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Jul 2010 19:13:10 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 70A61CB030C for ; Thu, 22 Jul 2010 21:13:05 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ddOeF3AT6xsW for ; Thu, 22 Jul 2010 21:13:05 +0200 (CEST) Received: from adijon-256-1-138-85.w90-13.abo.wanadoo.fr (ADijon-256-1-138-85.w90-13.abo.wanadoo.fr [90.13.25.85]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 4B928CB024B for ; Thu, 22 Jul 2010 21:13:05 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Fix ICE on aggregate of multidimensional array type Date: Thu, 22 Jul 2010 21:13:09 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201007222113.10089.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This was a latent problem, now exposed thanks to improved internal checks. The compiler aborts when trying to create a temporary of an addressable type, because of a VIEW_CONVERT_EXPR created in a formal conversion. Tested on i586-suse-linux, applied on the mainline. 2010-07-22 Eric Botcazou * gcc-interface/utils.c (gnat_types_compatible_p): Don't require strict equality for the component type of array types. 2010-07-22 Eric Botcazou * gnat.dg/aggr15.ad[sb]: New test. --- Eric Botcazou Index: gcc-interface/utils.c =================================================================== --- gcc-interface/utils.c (revision 162313) +++ gcc-interface/utils.c (working copy) @@ -2080,17 +2080,17 @@ gnat_types_compatible_p (tree t1, tree t && TYPE_PRECISION (TREE_TYPE (t1)) == TYPE_PRECISION (TREE_TYPE (t2))) return 1; - /* Array types are also compatible if they are constrained and have - the same component type and the same domain. */ + /* Array types are also compatible if they are constrained and have the same + domain and compatible component types. */ if (code == ARRAY_TYPE - && TREE_TYPE (t1) == TREE_TYPE (t2) && (TYPE_DOMAIN (t1) == TYPE_DOMAIN (t2) || (TYPE_DOMAIN (t1) && TYPE_DOMAIN (t2) && tree_int_cst_equal (TYPE_MIN_VALUE (TYPE_DOMAIN (t1)), TYPE_MIN_VALUE (TYPE_DOMAIN (t2))) && tree_int_cst_equal (TYPE_MAX_VALUE (TYPE_DOMAIN (t1)), - TYPE_MAX_VALUE (TYPE_DOMAIN (t2)))))) + TYPE_MAX_VALUE (TYPE_DOMAIN (t2))))) + && gnat_types_compatible_p (TREE_TYPE (t1), TREE_TYPE (t2))) return 1; /* Padding record types are also compatible if they pad the same