From patchwork Fri Oct 11 09:17:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 1175061 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-510730-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="Q8t2xFxn"; 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 46qMmg6l6mz9sCJ for ; Fri, 11 Oct 2019 20:17:38 +1100 (AEDT) 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=EGe3OphBdODvGzQ7 sE+iZVUHxlaKrBpBZhu5bMkFOheKlNMFlahtgo0akKC4AiO93zMIQDaPMA6kDAJc bcn7IYPksmnhLQYPmYQnXtt/F1PdXhZjH1cHxyOWh2rS8v9fKswhhOLPpRHwMBG6 BvVqUEIaQIy99jc5jqau91dLIuA= 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=OIaR6Gk/TQtzRcXTfbkANn mSD9o=; b=Q8t2xFxnzfr69QeJNNXN49H2U9oXv7Ek2t6Wm4w7Tc92svZCJRF0p6 WAvT3vYVW3ra9lUJi3a2fSPovTez9WGY17T08YkTo0gEONqrHzNg4shZ2QBKbSuC teN0F+fBq3jjCvkTp/y/8poIXJjm5O5wa2bouNXIZz3FkO9/1hFTA= Received: (qmail 67906 invoked by alias); 11 Oct 2019 09:17:31 -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 67898 invoked by uid 89); 11 Oct 2019 09:17:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, 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; Fri, 11 Oct 2019 09:17:29 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id AD52A81398 for ; Fri, 11 Oct 2019 11:17:27 +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 8Wxc4a8X3QLe for ; Fri, 11 Oct 2019 11:17:27 +0200 (CEST) Received: from polaris.localnet (unknown [IPv6:2a01:e35:8a16:3850:1a03:73ff:fe45:373a]) (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 883088139E for ; Fri, 11 Oct 2019 11:17:27 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Assorted gigi tweaks Date: Fri, 11 Oct 2019 11:17:25 +0200 Message-ID: <6687321.zpkmO0lCsV@polaris> MIME-Version: 1.0 Tested on x86_64-suse-linux, applied on the mainline. 2019-10-11 Eric Botcazou * gcc-interface/decl.c (elaborate_reference_1): Specifically deal with pointer displacement. * gcc-interface/decl.c (components_to_record): Use proper name. * gcc-interface/trans.c (Sloc_to_locus): Use standard types. Index: gcc-interface/decl.c =================================================================== --- gcc-interface/decl.c (revision 276873) +++ gcc-interface/decl.c (working copy) @@ -6782,6 +6782,15 @@ elaborate_reference_1 (tree ref, void *d elaborate_reference_1 (TREE_OPERAND (ref, 0), data), TREE_OPERAND (ref, 1), NULL_TREE); + /* If this is the displacement of a pointer, elaborate the pointer and then + displace the result. The actual purpose here is to drop the location on + the expression, which may be problematic if replicated on references. */ + if (TREE_CODE (ref) == POINTER_PLUS_EXPR + && TREE_CODE (TREE_OPERAND (ref, 1)) == INTEGER_CST) + return build2 (POINTER_PLUS_EXPR, TREE_TYPE (ref), + elaborate_reference_1 (TREE_OPERAND (ref, 0), data), + TREE_OPERAND (ref, 1)); + sprintf (suffix, "EXP%d", ++er->n); return elaborate_expression_1 (ref, er->entity, suffix, er->definition, false); @@ -7923,7 +7932,7 @@ components_to_record (Node_Id gnat_compo && !(Is_Packed (gnat_record_type) ? has_non_packed_fixed_size_field : Optimize_Alignment_Space (gnat_record_type)) - && !debug__debug_flag_dot_r); + && !Debug_Flag_Dot_R); const bool w_reorder = (Convention (gnat_record_type) == Convention_Ada && Warn_On_Questionable_Layout Index: gcc-interface/trans.c =================================================================== --- gcc-interface/trans.c (revision 276864) +++ gcc-interface/trans.c (working copy) @@ -10848,8 +10848,8 @@ Sloc_to_locus (Source_Ptr Sloc, location } Source_File_Index file = Get_Source_File_Index (Sloc); - Logical_Line_Number line = Get_Logical_Line_Number (Sloc); - Column_Number column = (clear_column ? 0 : Get_Column_Number (Sloc)); + Line_Number_Type line = Get_Logical_Line_Number (Sloc); + Column_Number_Type column = (clear_column ? 0 : Get_Column_Number (Sloc)); line_map_ordinary *map = LINEMAPS_ORDINARY_MAP_AT (line_table, file - 1); /* We can have zero if pragma Source_Reference is in effect. */