From patchwork Wed Jul 3 10:12:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 1126810 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-504279-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="f5VzuWqU"; dkim-atps=neutral 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 45dxjz1fBqz9s00 for ; Wed, 3 Jul 2019 20:12:16 +1000 (AEST) 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=SRpUuZHFW9OeKSKE AySiJKhtzy+fK0EbXHBtEpsehJf7pKdJDxAv0lASKOuA6QlKVpDRPeBTN0JL9zQ2 5oTLv0SYasYj6s90Qstmw4YQIqzfiI9j3cAe12XEtqfzQ8u1wDYx4LXknrxxO9+e zaeG+xWFm95vi8QlK0eA/q6HeMM= 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=LBhXjfFeSr8clxxBf34Ea6 fkW44=; b=f5VzuWqUeLEyVUL5Qye+HzSA6HEvEzw6dbidiapPdALOvGeaJ7zLrP LF2ViEegayQ3/grusHg3bH+ofD1eMcamjI78vw9WnuRwUuvJXYCKmDTu9muYX/50 0ShiaTSXv9uuPj9zk5xhZIEtz0Fr41+owXZjqVlcumZWyXuq0B3vQ= Received: (qmail 59534 invoked by alias); 3 Jul 2019 10:12:09 -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 59525 invoked by uid 89); 3 Jul 2019 10:12:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= 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 ESMTP; Wed, 03 Jul 2019 10:12:08 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 9BE3E81F5E for ; Wed, 3 Jul 2019 12:12:05 +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 Ae6D0iVyrSM9 for ; Wed, 3 Jul 2019 12:12:05 +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 7BE2C81A10 for ; Wed, 3 Jul 2019 12:12:05 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Fix debug info for discriminated record types Date: Wed, 03 Jul 2019 12:12:03 +0200 Message-ID: <2373481.7fSg0krngQ@polaris> MIME-Version: 1.0 Hi, this is a regression present on the mainline and 9 branch: since https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01066.html the debug info emitted in Ada with -fgnat-encodings=minimal for discriminated record types containing an array component whose bound is a discriminant is incomplete, i.e. the DW_AT_*_bound attribute of the range subtype is missing. Tested on x86_64-suse-linux, OK for mainline and 9 branch? 2019-07-03 Eric Botcazou * dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has the DW_AT_data_member_location attribute. 2019-07-03 Eric Botcazou * gnat.dg/specs/debug1.ads: New test. Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 272930) +++ dwarf2out.c (working copy) @@ -20845,6 +20845,7 @@ add_scalar_info (dw_die_ref die, enum dw if (decl_die != NULL) { if (get_AT (decl_die, DW_AT_location) + || get_AT (decl_die, DW_AT_data_member_location) || get_AT (decl_die, DW_AT_const_value)) { add_AT_die_ref (die, attr, decl_die);