[PATCH][TUPLES] Fix for GIMPLE_RESX region number remapping in tree-inline.c

Doug Kwan (關振德) dougkwan@google.com
Tue Apr 29 00:49:00 GMT 2008


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;
 }



More information about the Gcc-patches mailing list