]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/39345 (ICE in copy_tree_body_r, at tree-inline.c:1020)
authorH.J. Lu <hongjiu.lu@intel.com>
Tue, 3 Mar 2009 18:08:01 +0000 (18:08 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Tue, 3 Mar 2009 18:08:01 +0000 (10:08 -0800)
2009-03-03  H.J. Lu  <hongjiu.lu@intel.com>

PR middle-end/39345
* tree-inline.c (remapped_type): New.
(can_be_nonlocal): Call remapped_type instead of remap_type.

From-SVN: r144581

gcc/ChangeLog
gcc/tree-inline.c

index 38698827a125cf548eafd5e1a2a63b36ba3b8c22..3d4b017a92cc6e7556c4b7f45b387059be774381 100644 (file)
@@ -1,3 +1,9 @@
+2009-03-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR middle-end/39345
+       * tree-inline.c (remapped_type): New.
+       (can_be_nonlocal): Call remapped_type instead of remap_type.
+
 2009-03-03  Jakub Jelinek  <jakub@redhat.com>
 
        PR fortran/39354
index 88154bf91f388066e91335bc266e58fb206d52f4..63392e21c4bf2cb8ba83de65c29f8172637ecfb7 100644 (file)
@@ -426,6 +426,26 @@ remap_type (tree type, copy_body_data *id)
   return tmp;
 }
 
+/* Return previously remapped type of TYPE in ID.  Return NULL if TYPE
+   is NULL or TYPE has not been remapped before.  */
+
+static tree
+remapped_type (tree type, copy_body_data *id)
+{
+  tree *node;
+
+  if (type == NULL)
+    return type;
+
+  /* See if we have remapped this type.  */
+  node = (tree *) pointer_map_contains (id->decl_map, type);
+  if (node)
+    return *node;
+  else
+    return NULL;
+}
+
+  /* The type only needs remapping if it's variably modified.  */
 /* Decide if DECL can be put into BLOCK_NONLOCAL_VARs.  */
   
 static bool
@@ -446,8 +466,10 @@ can_be_nonlocal (tree decl, copy_body_data *id)
   if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != PARM_DECL)
     return false;
 
-  /* We must use global type.  */
-  if (TREE_TYPE (decl) != remap_type (TREE_TYPE (decl), id))
+  /* We must use global type.  We call remapped_type instead of
+     remap_type since we don't want to remap this type here if it
+     hasn't been remapped before.  */
+  if (TREE_TYPE (decl) != remapped_type (TREE_TYPE (decl), id))
     return false;
 
   /* Wihtout SSA we can't tell if variable is used.  */