From patchwork Tue Jan 9 13:15:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Patchwork-Id: 186378 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp102026dyi; Tue, 9 Jan 2024 05:22:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgLWNPTIIqm2aNXXp8sWSfBn2Xj+KQE3jgfnNt79vi6VNWUPVX0gpTlUUK7DZIfvzy9jna X-Received: by 2002:a05:6214:405:b0:680:ca42:cd5d with SMTP id z5-20020a056214040500b00680ca42cd5dmr5189144qvx.12.1704806524082; Tue, 09 Jan 2024 05:22:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704806524; cv=pass; d=google.com; s=arc-20160816; b=mS5PAyM5aygQDpvEV2U0W6N0LB/tCOfdV6G7ZjJDrS/fNAtnFV1B4cnufFWOQYQb1B 3eJexkSwnZi6kCGCz2INMp3Navc64Q5Oif2NV5aRotZKCwzxegkf3RW+5meyvgTGdutb L3kcnyP0VBBZnU9hfOnpEB8lC8IF/9PcaL+zOzf4Oo85bR+eMKbZ3qTsE8piaNeL6pxh Al6Ez+1cEpGiMQDbt+c3MuQS99PcShDMmtkKZRDr/NlZzukXECx0R6srMabXy6QiKz2y SYfuvn0rIzZ8+HTSfcpN5VVFsD4mh9njW32R9/2wGgT7dWhen9Vxz1zf2pJa459zCAM3 LGqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=NYNkkhhjS6quFP5l44VC83uPIfUA//ZcfiNnYsfofgo=; fh=QRb7QY4BZ0mIIAPiH2G4K0PcYKRtRn2i5A6VLUA8cN4=; b=oDbcMZbTutJxyVNI5VRWRJWtB1gvBPjGEZ2kL1PRcjBNibFdIHjuhlZvAjuqOlHNkC L4VspP4CBy7QtHOj8KxnDVoji27AGuYAj/GiPNNTA7OG/BgpuW7pb0ot3g788gWvLbRf zBrK+xwnmoPQco07nLB4NLOx69/84vu9yEvJoRdr+/kpL6Snqh5K1jGSiRKvkbxESyge Ow+Pjdv04MH1r+xSwJ81ulwVJmpa/4WEZITGi5boZVqMnjqT2JEClXQ22WJv/VvIu3cB 1mAeNeBYx+vpz5ab5yBPHwN6fUmqQRWPAcwlZj6TwDjLlEXfgwSflIL/wyywvnHcake6 EV5A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=OXgbHJGS; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id n16-20020a05620a223000b00781d55a23f8si1939651qkh.530.2024.01.09.05.22.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 05:22:04 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=OXgbHJGS; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C5BD5386188E for ; Tue, 9 Jan 2024 13:22:03 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 9424D3861825 for ; Tue, 9 Jan 2024 13:15:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9424D3861825 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9424D3861825 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704806147; cv=none; b=uSs3rkdM/F1CnUWAnDhIleXQOJO0WEeWz9icfOz7a+hJZODkMlKau4BnaV46NxGLydIc1o77Jxm3etbhDgzrkJ+UBp0QZvmN5CcjE/xZyZ7t31yhuyxIOQFaPGk5pm8QUD9VGSVLcx6dxYfI+rsV9uKAFWPsviksTK0vl328cTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704806147; c=relaxed/simple; bh=YVPS2FmI0SsMPJ6R184AKz2jzWy98i4mrTZKaWfGl78=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fIIIvlWRYVvcTUWx+ezbVbcHrqCMnEVDDryRy1jHGSWhLtCy0MAlopBnuTPbspsVQNI/BdRsc7fB+AWNHYxe3Ed0lHrrq+1ZescCXfPsiIw1xS4RoIpdeYJS3VRhQuwvILhEs1pu0mAL6oNNuUliX6Fcxs/Pn1dlKiNTPWsC388= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40d5a41143fso32654925e9.3 for ; Tue, 09 Jan 2024 05:15:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1704806142; x=1705410942; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=NYNkkhhjS6quFP5l44VC83uPIfUA//ZcfiNnYsfofgo=; b=OXgbHJGSfy8GI8c2MxzsiWJscpNdB9gI0f4sC3c6h6w8hE9YHyokKS3r/r0trFFct1 1y6mKKHOydzYlIXC0h6d6BwcoLKTdWduC2x8tzBsSK8q+T3nrbAOaJrIHbGetS/2kEI+ NddyGKdv2xT400xPeFJXeVXAjEKbSG2ej9crQft1i2Pu47TUgOPOrH7aV7zBVOaKiR04 GNUGyFDDwm1A8ARibf0O1tXqwd5O8ZAEogXltRzfFrjGrTrA9rCEI2m7lnpf0QhvpIBv MLin2/fVJD35As6HIQBi2sZPi64bIrWeT0v29is2jRpJEgLECPlSXPRrgLkjaQgceDFY uLAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704806142; x=1705410942; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NYNkkhhjS6quFP5l44VC83uPIfUA//ZcfiNnYsfofgo=; b=aNkg3keGreLtT22qiw094ie3WItGKuTp2W4nOawyLPcMuj7WdFS2ywRCoblOqLvZAW pRQ4ekChDaAQ0oTxCQ2TEHuQtwam7ka9MsjZfp/UMkcBBZZs1I9dADHhsNsBCNJuZt+l fHXMOJ12hNWoonJ92YmWZhLKd3ejBKh5VCLRJwcYCuNKpa1TCpgt6LSiw7AmrUI5nuwv 7LoJTRdwOn840RNeP9I207vMJZfj55Atq6YwCr/OmCQPQpEt2ymI9DOtKdpqlL/bSeJb HQACHMO/mpf+c+4S0kt81fEIXEoCNz57DT9Jje0M+pJoOBhmU/4y1MjGPFE+Ro2eLASz 9PgA== X-Gm-Message-State: AOJu0Yzrh9BVWgw2hF5qRqHXQDn3XKjHGjMk7x3NN8lISUeHAF1S7Tji 8qNF5BRI7Zv3ijXkUXQJm4TugBrOwjAHeFDFrL6iZ8MutA== X-Received: by 2002:a05:600c:c5:b0:40e:4cae:a3d4 with SMTP id u5-20020a05600c00c500b0040e4caea3d4mr760505wmm.184.1704806142256; Tue, 09 Jan 2024 05:15:42 -0800 (PST) Received: from poulhies-Precision-5550.telnowedge.local (lmontsouris-659-1-24-67.w81-250.abo.wanadoo.fr. [81.250.175.67]) by smtp.gmail.com with ESMTPSA id fj14-20020a05600c0c8e00b0040d83ab2ecdsm3786063wmb.21.2024.01.09.05.15.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 05:15:40 -0800 (PST) From: =?utf-8?q?Marc_Poulhi=C3=A8s?= To: gcc-patches@gcc.gnu.org Cc: Piotr Trojanek Subject: [COMMITTED] ada: Remove dead detection of recursive inlined subprograms Date: Tue, 9 Jan 2024 14:15:40 +0100 Message-ID: <20240109131540.744255-1-poulhies@adacore.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787619206048854531 X-GMAIL-MSGID: 1787619206048854531 From: Piotr Trojanek Inlining of subprogram calls happens in routine Expand_Inlined_Call which calls Establish_Actual_Mapping_For_Inlined_Call. Both routines had detection of recursive calls. The detection in the second routine was dead code. gcc/ada/ * inline.adb (Establish_Actual_Mapping_For_Inlined_Call): Remove detection of recursive calls. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/inline.adb | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index f6bed4d26e3..dffd6293394 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -2988,25 +2988,6 @@ package body Inline is F := First_Formal (Subp); A := First_Actual (N); while Present (F) loop - if Present (Renamed_Object (F)) then - - -- If expander is active, it is an error to try to inline a - -- recursive subprogram. In GNATprove mode, just indicate that the - -- inlining will not happen, and mark the subprogram as not always - -- inlined. - - if GNATprove_Mode then - Cannot_Inline - ("cannot inline call to recursive subprogram?", N, Subp); - Set_Is_Inlined_Always (Subp, False); - else - Error_Msg_N - ("cannot inline call to recursive subprogram", N); - end if; - - return; - end if; - -- Reset Last_Assignment for any parameters of mode out or in out, to -- prevent spurious warnings about overwriting for assignments to the -- formal in the inlined code.