From patchwork Sat Jun 11 11:24:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 634050 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rRcC329KRz9sDC for ; Sat, 11 Jun 2016 21:24:44 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=bBqRBfn8; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=eNwUEbtJhtBT/uWo AybLT0f2HUI6gMbl80GQB+xNf01t0yPkO09UywRnWBch0yFwvgtBwByXOy3lQOmY CRHXwvTQCVG5Ju0kbO+CsC6zshU3GAyJlKsAav82W0A4oZ8AZA0cJcNQy2YzaANY xmdslEhtxZ1W3JuJPpQ6TGZF5rs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=7EM7Z84gfd8gpPSyreySNe VPDMM=; b=bBqRBfn8MpgvSukznl59d8dd1H1nVcgY0azjbyRr4OqAs1Q5etstT7 q+15tEhI+BDU1HxMaPJzbkygtGJJVOUe3k6oiO8d+G/U/jERcUvo9lTSqP++fAIk kCvSgfctmQ3VP2usKYimc6Gg+jTDtGJ/Huw1+ZAqJWdWiznXS2F14= Received: (qmail 68643 invoked by alias); 11 Jun 2016 11:24:37 -0000 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 Received: (qmail 68628 invoked by uid 89); 11 Jun 2016 11:24:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=xut, XUT, Hx-languages-length:2151, HContent-Transfer-Encoding:7Bit X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 11 Jun 2016 11:24:24 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 411C7812EA for ; Sat, 11 Jun 2016 13:24:21 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LcyAD7ijwpeW for ; Sat, 11 Jun 2016 13:24:21 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 1B06C812E6 for ; Sat, 11 Jun 2016 13:24:20 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Fix small oversight for unconstrained array types Date: Sat, 11 Jun 2016 13:24:20 +0200 Message-ID: <1652698.7ODzBx7bQ1@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-35-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 This fixes a small oversight introduced in gigi some time ago, whereby the UNCONSTRAINED_ARRAY_TYPE object created for unconstrained array types gets the XUT suffix like the associate RECORD_TYPE. Tested on x86_64-suse-linux, applied on the mainline and 6 branch. 2016-06-11 Pierre-Marie de Rodat * gcc-interface/decl.c (gnat_to_gnu_entity): Do not clobber gnat_entity_name with temporary names for XUP and XUT types. Index: gcc-interface/decl.c =================================================================== --- gcc-interface/decl.c (revision 237323) +++ gcc-interface/decl.c (working copy) @@ -2335,10 +2335,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entit gnat_name = Packed_Array_Impl_Type (gnat_entity); else gnat_name = gnat_entity; - if (gnat_encodings != DWARF_GNAT_ENCODINGS_MINIMAL) - gnu_entity_name = create_concat_name (gnat_name, "XUP"); - create_type_decl (gnu_entity_name, gnu_fat_type, artificial_p, - debug_info_p, gnat_entity); + tree xup_name + = (gnat_encodings == DWARF_GNAT_ENCODINGS_MINIMAL) + ? get_entity_name (gnat_name) + : create_concat_name (gnat_name, "XUP"); + create_type_decl (xup_name, gnu_fat_type, artificial_p, debug_info_p, + gnat_entity); /* Create the type to be designated by thin pointers: a record type for the array and its template. We used to shift the fields to have the @@ -2348,11 +2350,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entit Note that GDB can handle standard DWARF information for them, so we don't have to name them as a GNAT encoding, except if specifically asked to. */ - if (gnat_encodings != DWARF_GNAT_ENCODINGS_MINIMAL) - gnu_entity_name = create_concat_name (gnat_name, "XUT"); - else - gnu_entity_name = get_entity_name (gnat_name); - tem = build_unc_object_type (gnu_template_type, tem, gnu_entity_name, + tree xut_name + = (gnat_encodings == DWARF_GNAT_ENCODINGS_MINIMAL) + ? get_entity_name (gnat_name) + : create_concat_name (gnat_name, "XUT"); + tem = build_unc_object_type (gnu_template_type, tem, xut_name, debug_info_p); SET_TYPE_UNCONSTRAINED_ARRAY (tem, gnu_type);