OSDN Git Service

Remove spurious ChangeLog entry
[pf3gnuchains/gcc-fork.git] / gcc / tree-inline.c
index 49488d4..0e553c8 100644 (file)
@@ -663,6 +663,9 @@ copy_statement_list (tree *tp)
     {
       tree stmt = tsi_stmt (oi);
       if (TREE_CODE (stmt) == STATEMENT_LIST)
+       /* This copy is not redundant; tsi_link_after will smash this
+          STATEMENT_LIST into the end of the one we're building, and we
+          don't want to do that with the original.  */
        copy_statement_list (&stmt);
       tsi_link_after (&ni, stmt, TSI_CONTINUE_LINKING);
     }
@@ -813,9 +816,15 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
     {
       /* Otherwise, just copy the node.  Note that copy_tree_r already
         knows not to copy VAR_DECLs, etc., so this is safe.  */
+
+      /* We should never have TREE_BLOCK set on non-statements.  */
+      if (EXPR_P (*tp))
+       gcc_assert (!TREE_BLOCK (*tp));
+
       if (TREE_CODE (*tp) == MEM_REF)
        {
          tree ptr = TREE_OPERAND (*tp, 0);
+         tree type = remap_type (TREE_TYPE (*tp), id);
          tree old = *tp;
          tree tem;
 
@@ -826,7 +835,7 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
          if ((tem = maybe_fold_offset_to_reference (EXPR_LOCATION (*tp),
                                                     ptr,
                                                     TREE_OPERAND (*tp, 1),
-                                                    TREE_TYPE (*tp)))
+                                                    type))
              && TREE_THIS_VOLATILE (tem) == TREE_THIS_VOLATILE (old))
            {
              tree *tem_basep = &tem;
@@ -848,7 +857,7 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
            }
          else
            {
-             *tp = fold_build2 (MEM_REF, TREE_TYPE (*tp),
+             *tp = fold_build2 (MEM_REF, type,
                                 ptr, TREE_OPERAND (*tp, 1));
              TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
              TREE_THIS_NOTRAP (*tp) = TREE_THIS_NOTRAP (old);
@@ -862,6 +871,9 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
         tweak some special cases.  */
       copy_tree_r (tp, walk_subtrees, NULL);
 
+      if (TREE_CODE (*tp) != OMP_CLAUSE)
+       TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id);
+
       /* Global variables we haven't seen yet need to go into referenced
         vars.  If not referenced from types only.  */
       if (gimple_in_ssa_p (cfun)
@@ -870,13 +882,6 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
          && !processing_debug_stmt)
        add_referenced_var (*tp);
 
-      /* We should never have TREE_BLOCK set on non-statements.  */
-      if (EXPR_P (*tp))
-       gcc_assert (!TREE_BLOCK (*tp));
-
-      if (TREE_CODE (*tp) != OMP_CLAUSE)
-       TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id);
-
       if (TREE_CODE (*tp) == TARGET_EXPR && TREE_OPERAND (*tp, 3))
        {
          /* The copied TARGET_EXPR has never been expanded, even if the
@@ -4271,19 +4276,9 @@ copy_tree_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
       *tp = new_tree;
     }
   else if (code == STATEMENT_LIST)
-    {
-      /* We used to just abort on STATEMENT_LIST, but we can run into them
-         with statement-expressions (c++/40975).  */
-      tree new_list = alloc_stmt_list ();
-      tree_stmt_iterator i = tsi_start (*tp);
-      tree_stmt_iterator j = tsi_last (new_list);
-      for (; !tsi_end_p (i); tsi_next (&i))
-       {
-         tree stmt = tsi_stmt (i);
-         tsi_link_after (&j, stmt, TSI_CONTINUE_LINKING);
-       }
-      *tp = new_list;
-    }
+    /* We used to just abort on STATEMENT_LIST, but we can run into them
+       with statement-expressions (c++/40975).  */
+    copy_statement_list (tp);
   else if (TREE_CODE_CLASS (code) == tcc_type)
     *walk_subtrees = 0;
   else if (TREE_CODE_CLASS (code) == tcc_declaration)
@@ -5237,7 +5232,7 @@ maybe_inline_call_in_expr (tree exp)
       id.transform_call_graph_edges = CB_CGE_DUPLICATE;
       id.transform_new_cfg = false;
       id.transform_return_to_modify = true;
-      id.transform_lang_insert_block = false;
+      id.transform_lang_insert_block = NULL;
 
       /* Make sure not to unshare trees behind the front-end's back
         since front-end specific mechanisms may rely on sharing.  */