From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7871) id E55BF385841D; Tue, 20 Jun 2023 11:26:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E55BF385841D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687260378; bh=XQTN/ryGhQuQP7IrdM+zMRNdvW1Nw3lxO3oljlRb/F4=; h=From:To:Subject:Date:From; b=gJlIUQ0aOB7eNOihMCYWzCiWq9V/509FsBzyTtHOXhVrZIS6dqDHkIvzggPda/o3a x6wQUj39UBf1DFK14WjMeavbr+9IDJ8dw1PF1YNYgTAFzTflwfp1UYlpBJ0uXidX+f QDRpCKsXTmBh+fv3lEzq0+AojwApYraaZTauFF9g= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Marc Poulhi?s To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1986] ada: Fix crash on inlining in GNATprove X-Act-Checkin: gcc X-Git-Author: Yannick Moy X-Git-Refname: refs/heads/master X-Git-Oldrev: 865c5db7cbc16de9887d5941be9a63a7fa03692e X-Git-Newrev: c11ef75cb2cd60b0c4408aa8ed1898b69b8c946a Message-Id: <20230620112618.E55BF385841D@sourceware.org> Date: Tue, 20 Jun 2023 11:26:18 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c11ef75cb2cd60b0c4408aa8ed1898b69b8c946a commit r14-1986-gc11ef75cb2cd60b0c4408aa8ed1898b69b8c946a Author: Yannick Moy Date: Thu Jun 8 16:52:24 2023 +0200 ada: Fix crash on inlining in GNATprove After the recent change on detection of non-inlining, calls inside the iterator part of a quantified expression were not considered as preventing inlining anymore, leading to a crash later on inside GNATprove. Now fixed. gcc/ada/ * sem_res.adb (Resolve_Call): Fix change that replaced test for quantified expressions by the test for potentially unevaluated contexts. Both should be performed. Diff: --- gcc/ada/sem_res.adb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index f4dfc041cd6..2c8efec524b 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -7300,6 +7300,15 @@ package body Sem_Res is ("cannot inline & (in potentially unevaluated context)?", N, Nam_UA); + -- Calls are not inlined inside the loop_parameter_specification + -- or iterator_specification of the quantified expression, as they + -- are only preanalyzed. Calls in the predicate part are handled + -- by the previous test on potentially unevaluated expressions. + + elsif In_Quantified_Expression (N) then + Cannot_Inline + ("cannot inline & (in quantified expression)?", N, Nam_UA); + -- Inlining should not be performed during preanalysis elsif Full_Analysis then