aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2021-10-07 17:34:21 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2021-10-11 13:38:13 +0000
commit4a0d6b70e3877728772b177e35b0a429d5501698 (patch)
tree45810f3bc67f9a875ba991b8e08fd1e1be40a2e1
parent5ea133c6ce09fbeeec91457a38689cdac7c05d91 (diff)
downloadgcc-4a0d6b70e3877728772b177e35b0a429d5501698.zip
gcc-4a0d6b70e3877728772b177e35b0a429d5501698.tar.gz
gcc-4a0d6b70e3877728772b177e35b0a429d5501698.tar.bz2
[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.
-rw-r--r--gcc/ada/gcc-interface/trans.c9
1 files 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;