From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1914) id 13485398A414; Wed, 16 Jun 2021 08:44:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13485398A414 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Pierre-Marie de Rodat To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1507] [Ada] Fix ALI source location for dominance markers X-Act-Checkin: gcc X-Git-Author: Matthieu Eyraud X-Git-Refname: refs/heads/master X-Git-Oldrev: ff4746bcdefb170e9583b673d29af474b7ca0786 X-Git-Newrev: 7626537ae7643013855cf28f82b16239314f20d1 Message-Id: <20210616084458.13485398A414@sourceware.org> Date: Wed, 16 Jun 2021 08:44:58 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jun 2021 08:44:58 -0000 https://gcc.gnu.org/g:7626537ae7643013855cf28f82b16239314f20d1 commit r12-1507-g7626537ae7643013855cf28f82b16239314f20d1 Author: Matthieu Eyraud Date: Tue Feb 23 08:54:30 2021 +0100 [Ada] Fix ALI source location for dominance markers gcc/ada/ * par_sco.adb (Set_Statement_Entry): Change sloc for dominance marker. (Traverse_One): Fix typo. (Output_Header): Fix comment. Diff: --- gcc/ada/par_sco.adb | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/gcc/ada/par_sco.adb b/gcc/ada/par_sco.adb index 638cb3579de..b4f76091f44 100644 --- a/gcc/ada/par_sco.adb +++ b/gcc/ada/par_sco.adb @@ -683,9 +683,12 @@ package body Par_SCO is -- two levels (through the pragma argument association) to -- get to the pragma node itself. For the guard on a select -- alternative, we do not have access to the token location for - -- the WHEN, so we use the first sloc of the condition itself - -- (note: we use First_Sloc, not Sloc, because this is what is - -- referenced by dominance markers). + -- the WHEN, so we use the first sloc of the condition itself. + -- First_Sloc gives the most sensible result, but we have to + -- beware of also using it when computing the dominance marker + -- sloc (in the Set_Statement_Entry procedure), as this is not + -- fully equivalent to the "To" sloc computed by + -- Sloc_Range (Guard, To, From). -- Doesn't this requirement of using First_Sloc need to be -- documented in the spec ??? @@ -1579,6 +1582,18 @@ package body Par_SCO is To := No_Location; end if; + -- Be consistent with the location determined in + -- Output_Header. + + if Current_Dominant.K = 'T' + and then Nkind (Parent (Current_Dominant.N)) + in N_Accept_Alternative + | N_Delay_Alternative + | N_Terminate_Alternative + then + From := First_Sloc (Current_Dominant.N); + end if; + Set_Raw_Table_Entry (C1 => '>', C2 => Current_Dominant.K, @@ -1867,7 +1882,7 @@ package body Par_SCO is Process_Decisions_Defer (Cond, 'G'); -- For an entry body with a barrier, the entry body - -- is dominanted by a True evaluation of the barrier. + -- is dominated by a True evaluation of the barrier. Inner_Dominant := ('T', N); end if;