From patchwork Wed Dec 13 09:30:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 847908 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-469100-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="PZ5Z3krb"; 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 3yxWdt0jZGz9sCZ for ; Wed, 13 Dec 2017 20:30:57 +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=QJDJKJbsKc0iK1fI vv+T54pamIcyrfP/IPs4O8Yl2vhaM59dYNHSACkxtCHAc6TKU2RqUttxCvVFNf2x cHknsMh82FybIlwWyPwkpNjyuSkLBz5IbSreqEhKHYOe/gqsW7RNI6sX8+2rzxW2 vupuEk4W2JnhX6Zy2ojCdE2DeIk= 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=vBZHeNBFtb/0tvDNhCwZlk A1kjA=; b=PZ5Z3krb7j2CZloVvahPRWbl1dtovt7JE56pdmuHyQUdh43VvJcm/5 uLOAHXv8t7eYk0H7pZiwCT7ib+xclPtv0zqNUGuj7UST4gTzxrOcGrWWcFLr+KlF 5Iuwc/KfyeVNE3mG/RavhCNlpPU/3gm/jcAEsX2G3Dj80WuiIhrcE= Received: (qmail 121367 invoked by alias); 13 Dec 2017 09:30:49 -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 121165 invoked by uid 89); 13 Dec 2017 09:30:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:936 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, 13 Dec 2017 09:30:47 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 76E338220F for ; Wed, 13 Dec 2017 10:30:45 +0100 (CET) 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 1s6LG4zme3JK for ; Wed, 13 Dec 2017 10:30:45 +0100 (CET) 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 4EB4E8138E for ; Wed, 13 Dec 2017 10:30:45 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Make sure subprogram locus is initialized Date: Wed, 13 Dec 2017 10:30:44 +0100 Message-ID: <1723612.iInQtfIT1g@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-53-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 This is another fixlet aimed at making gigi more robust in the presence of unexpected nodes in the expanded code. Tested on x86_64-suse-linux, applied on the mainline and 7 branch. 2017-12-13 Eric Botcazou * gcc-interface/trans.c (Subprogram_Body_to_gnu): Initialize locus. Index: gcc-interface/trans.c =================================================================== --- gcc-interface/trans.c (revision 255601) +++ gcc-interface/trans.c (working copy) @@ -3773,7 +3773,8 @@ Subprogram_Body_to_gnu (Node_Id gnat_nod } /* Set the line number in the decl to correspond to that of the body. */ - Sloc_to_locus (Sloc (gnat_node), &locus); + if (!Sloc_to_locus (Sloc (gnat_node), &locus)) + locus = input_location; DECL_SOURCE_LOCATION (gnu_subprog_decl) = locus; /* If the body comes from an expression function, arrange it to be inlined