From patchwork Wed Nov 10 11:34:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 70623 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 BD6F8B6ED0 for ; Wed, 10 Nov 2010 22:35:45 +1100 (EST) Received: (qmail 2221 invoked by alias); 10 Nov 2010 11:35:44 -0000 Received: (qmail 2132 invoked by uid 22791); 10 Nov 2010 11:35:43 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Nov 2010 11:35:37 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id EC7A7CB031D for ; Wed, 10 Nov 2010 12:35:34 +0100 (CET) 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 QItX9efA0YHF for ; Wed, 10 Nov 2010 12:35:34 +0100 (CET) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id C58ADCB031A for ; Wed, 10 Nov 2010 12:35:34 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Fix ICE with -gnatVa -g on UC to Float Date: Wed, 10 Nov 2010 12:34:44 +0100 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201011101234.45071.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 is a regression present on the mainline: the compiler aborts when trying to generate debug info for a temporary initialized to an unchecked conversion from record type for Float. Fixed by not generating debug info in this case. Tested on i586-suse-linux, applied on the mainline. 2010-11-10 Eric Botcazou * gcc-interface/decl.c (gnat_to_gnu_entity): Do not set DECL_ARTIFICIAL on the reused DECL node coming from a renamed object. Set DECL_IGNORED_P on the DECL node built for renaming entities if they don't need debug info. 2010-11-10 Eric Botcazou * gnat.dg/unchecked_convert7.adb: New test. Index: gcc-interface/decl.c =================================================================== --- gcc-interface/decl.c (revision 166490) +++ gcc-interface/decl.c (working copy) @@ -4894,13 +4894,17 @@ gnat_to_gnu_entity (Entity_Id gnat_entit Set_RM_Size (gnat_entity, annotate_value (rm_size (gnu_type))); } - if (!Comes_From_Source (gnat_entity) && DECL_P (gnu_decl)) - DECL_ARTIFICIAL (gnu_decl) = 1; + /* If we really have a ..._DECL node, set a couple of flags on it. But we + cannot do that if we are reusing the ..._DECL node made for a renamed + object, since the predicates don't apply to it but to GNAT_ENTITY. */ + if (DECL_P (gnu_decl) && !(Present (Renamed_Object (gnat_entity)) && saved)) + { + if (!Comes_From_Source (gnat_entity)) + DECL_ARTIFICIAL (gnu_decl) = 1; - if (!debug_info_p && DECL_P (gnu_decl) - && TREE_CODE (gnu_decl) != FUNCTION_DECL - && No (Renamed_Object (gnat_entity))) - DECL_IGNORED_P (gnu_decl) = 1; + if (!debug_info_p && TREE_CODE (gnu_decl) != FUNCTION_DECL) + DECL_IGNORED_P (gnu_decl) = 1; + } /* If we haven't already, associate the ..._DECL node that we just made with the input GNAT entity node. */