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: 1884460 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=OXgbHJGS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4T8WmN16dTz1yPf for ; Wed, 10 Jan 2024 00:21:40 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A330386182B for ; Tue, 9 Jan 2024 13:21:38 +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-Google-Smtp-Source: AGHT+IGx6Q/3ft2Ys8E44N2INvH6BqXDwOvIU/oiSga6CSmu2o+SMtV8ubWul2IccNZa48/HDooTzg== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org 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.