From 4a0d6b70e3877728772b177e35b0a429d5501698 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Thu, 7 Oct 2021 17:34:21 +0200 Subject: [PATCH] [Ada] Tweak the warning about missing local raises gcc/ada/ * gcc-interface/trans.c (gnat_to_gnu) : Given the warning only if No_Exception_Propagation is active. : Likewise. : Likewise. --- 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 3fec060..8a192c7 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; -- 2.7.4