This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][TUPLES] Fix for GIMPLE_RESX region number remapping in tree-inline.c
- From: "=?big5?b?RG91ZyBLd2FuICjD9q62vHcp?=" <dougkwan at google dot com>
- To: "Diego Novillo" <dnovillo at google dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 28 Apr 2008 13:43:45 -0700
- Subject: [PATCH][TUPLES] Fix for GIMPLE_RESX region number remapping in tree-inline.c
Hi Diego,
Could you please review this? It fixed a number of errors in
libstdc++-v3 build.
-Doug
---------------------
2008-04-28 Doug Kwan <dougkwan@google.com>
* tree-inline.c (remap_gimple_op_r): Remove code to handle RESX_EXPR
region number remapping.
(remap_gimple_stmt): Add code to handle GIMPLE_RESX region number
remapping.
Index: gcc/gcc/tree-inline.c
===================================================================
--- gcc/gcc/tree-inline.c (revision 134756)
+++ gcc/gcc/tree-inline.c (working copy)
@@ -739,12 +739,6 @@ remap_gimple_op_r (tree *tp, int *walk_s
&& id->remapping_type_depth == 0)
add_referenced_var (*tp);
- if (TREE_CODE (*tp) == RESX_EXPR && id->eh_region_offset)
- TREE_OPERAND (*tp, 0) =
- build_int_cst (NULL_TREE,
- id->eh_region_offset
- + TREE_INT_CST_LOW (TREE_OPERAND (*tp, 0)));
-
if (TREE_CODE (*tp) != OMP_CLAUSE)
TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id);
@@ -1157,6 +1151,12 @@ remap_gimple_stmt (gimple stmt, copy_bod
wi.info = id;
walk_gimple_op (copy, remap_gimple_op_r, &wi);
+ /* We have to handle EH region remapping of GIMPLE_RESX specially because
+ the region number is not an operand. */
+ if (gimple_code (stmt) == GIMPLE_RESX && id->eh_region_offset)
+ {
+ gimple_resx_set_region (copy, gimple_resx_region (stmt) +
id->eh_region_offset);
+ }
return copy;
}