public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Marc Poulhi?s <dkm@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-3731] ada: Remove redundant suppression for non-modified IN OUT parameters
Date: Mon,  7 Nov 2022 08:39:07 +0000 (GMT)	[thread overview]
Message-ID: <20221107083907.94F5C3858413@sourceware.org> (raw)

https://gcc.gnu.org/g:dcc02d3168b4457746f6ab1d8e73cf9d15c6d4e8

commit r13-3731-gdcc02d3168b4457746f6ab1d8e73cf9d15c6d4e8
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Tue Sep 6 00:24:17 2022 +0200

    ada: Remove redundant suppression for non-modified IN OUT parameters
    
    Non-modified IN OUT parameters are first collected and then filtered by
    examining uses of their enclosing subprograms. In this filtering we
    don't need to look again at properties of the formal parameters
    themselves.
    
    Cleanup related to improved detection of references to uninitialized
    objects; semantics is unaffected.
    
    gcc/ada/
    
            * sem_warn.adb
            (No_Warn_On_In_Out): For subprograms we can simply call
            Warnings_Off.
            (Output_Non_Modified_In_Out_Warnings): Remove repeated
            suppression.

Diff:
---
 gcc/ada/sem_warn.adb | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 4552d907bac..1bfa8449ad7 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -3006,9 +3006,9 @@ package body Sem_Warn is
          then
             return True;
 
-         --  Else test warnings off
+         --  Else test warnings off on the subprogram
 
-         elsif Warnings_Off_Check_Spec (S) then
+         elsif Warnings_Off (S) then
             return True;
 
          --  All tests for suppressing warning failed
@@ -3029,11 +3029,9 @@ package body Sem_Warn is
 
          begin
             --  Suppress warning in specific cases (see details in comments for
-            --  No_Warn_On_In_Out), or if there is a pragma Unmodified.
+            --  No_Warn_On_In_Out).
 
-            if Has_Pragma_Unmodified_Check_Spec (E1)
-              or else No_Warn_On_In_Out (E1)
-            then
+            if No_Warn_On_In_Out (E1) then
                null;
 
             --  Here we generate the warning

                 reply	other threads:[~2022-11-07  8:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221107083907.94F5C3858413@sourceware.org \
    --to=dkm@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).