]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Patch by Richard Henderson:
authorJan Hubicka <jh@suse.cz>
Sat, 14 May 2005 14:32:39 +0000 (16:32 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 14 May 2005 14:32:39 +0000 (14:32 +0000)
* tree-eh.c (tree_can_throw_internal, tree_can_throw_external):
Handle RESX expressions properly.

From-SVN: r99698

gcc/ChangeLog
gcc/tree-eh.c

index 090a75461156fb2adadef9a5a25801a88a1c80c1..42b8984b1c8a79c599010c1666fc064ec3c61537 100644 (file)
@@ -1,5 +1,9 @@
 2005-05-14  Jan Hubicka  <jh@suse.cz>
 
+       Patch by Richard Henderson:
+       * tree-eh.c (tree_can_throw_internal, tree_can_throw_external):
+       Handle RESX expressions properly.
+
        * tree-eh.c (record_stmt_eh_region): Use add_stmt_to_eh_region.
        (add_stmt_to_eh_region_fn): Nest into CALL_EXPR.
        (remove_stmt_from_eh_region_fn): Likewise.
index 3315ffe85d29a4fc18cf6cdda839063d4e34d193..7d83746b501d53e3d4e267ce40c23f5276aea5f5 100644 (file)
@@ -2008,7 +2008,12 @@ tree_could_throw_p (tree t)
 bool
 tree_can_throw_internal (tree stmt)
 {
-  int region_nr = lookup_stmt_eh_region (stmt);
+  int region_nr;
+
+  if (TREE_CODE (stmt) == RESX_EXPR)
+    region_nr = TREE_INT_CST_LOW (TREE_OPERAND (stmt, 0));
+  else
+    region_nr = lookup_stmt_eh_region (stmt);
   if (region_nr < 0)
     return false;
   return can_throw_internal_1 (region_nr);
@@ -2017,10 +2022,16 @@ tree_can_throw_internal (tree stmt)
 bool
 tree_can_throw_external (tree stmt)
 {
-  int region_nr = lookup_stmt_eh_region (stmt);
+  int region_nr;
+
+  if (TREE_CODE (stmt) == RESX_EXPR)
+    region_nr = TREE_INT_CST_LOW (TREE_OPERAND (stmt, 0));
+  else
+    region_nr = lookup_stmt_eh_region (stmt);
   if (region_nr < 0)
-    return false;
-  return can_throw_external_1 (region_nr);
+    return tree_could_throw_p (stmt);
+  else
+    return can_throw_external_1 (region_nr);
 }
 
 bool