public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4317] [Ada] Tweak the warning about missing local raises
@ 2021-10-11 13:41 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-10-11 13:41 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4a0d6b70e3877728772b177e35b0a429d5501698

commit r12-4317-g4a0d6b70e3877728772b177e35b0a429d5501698
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Thu Oct 7 17:34:21 2021 +0200

    [Ada] Tweak the warning about missing local raises
    
    gcc/ada/
    
            * gcc-interface/trans.c (gnat_to_gnu) <N_Pop_Constraint_Error_Label>:
            Given the warning only if No_Exception_Propagation is active.
            <N_Pop_Storage_Error_Label>: Likewise.
            <N_Pop_Program_Error_Label>: Likewise.

Diff:
---
 gcc/ada/gcc-interface/trans.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 3fec0601bbf..8a192c7ca9b 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -7872,21 +7872,24 @@ gnat_to_gnu (Node_Id gnat_node)
     case N_Pop_Constraint_Error_Label:
       gnat_temp = gnu_constraint_error_label_stack.pop ();
       if (Present (gnat_temp)
-	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false)))
+	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false))
+	  && No_Exception_Propagation_Active ())
 	Warn_If_No_Local_Raise (gnat_temp);
       break;
 
     case N_Pop_Storage_Error_Label:
       gnat_temp = gnu_storage_error_label_stack.pop ();
       if (Present (gnat_temp)
-	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false)))
+	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false))
+	  && No_Exception_Propagation_Active ())
 	Warn_If_No_Local_Raise (gnat_temp);
       break;
 
     case N_Pop_Program_Error_Label:
       gnat_temp = gnu_program_error_label_stack.pop ();
       if (Present (gnat_temp)
-	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false)))
+	  && !TREE_USED (gnat_to_gnu_entity (gnat_temp, NULL_TREE, false))
+	  && No_Exception_Propagation_Active ())
 	Warn_If_No_Local_Raise (gnat_temp);
       break;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-11 13:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 13:41 [gcc r12-4317] [Ada] Tweak the warning about missing local raises Pierre-Marie de Rodat

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).