OSDN Git Service

ChangeLog:
[pf3gnuchains/gcc-fork.git] / gcc / ipa-struct-reorg.c
index 9ca5364..bc84eee 100644 (file)
@@ -34,7 +34,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "pointer-set.h"
 #include "hashtab.h"
-#include "c-tree.h"
 #include "toplev.h"
 #include "flags.h"
 #include "debug.h"
@@ -53,7 +52,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "opts.h"
 #include "ipa-type-escape.h"
 #include "tree-dump.h"
-#include "c-common.h"
 #include "gimple.h"
 
 /* This optimization implements structure peeling.
@@ -606,13 +604,17 @@ gen_size (tree num, tree type, tree *res)
   if (exact_log2 (struct_size_int) == -1)
     {
       tree size = build_int_cst (TREE_TYPE (num), struct_size_int);
-      new_stmt = gimple_build_assign_with_ops (MULT_EXPR, *res, num, size);
+      new_stmt = gimple_build_assign (*res, fold_build2 (MULT_EXPR,
+                                                        TREE_TYPE (num),
+                                                        num, size));
     }
   else
     {
       tree C = build_int_cst (TREE_TYPE (num), exact_log2 (struct_size_int));
  
-      new_stmt = gimple_build_assign_with_ops (LSHIFT_EXPR, *res, num, C);
+      new_stmt = gimple_build_assign (*res, fold_build2 (LSHIFT_EXPR,
+                                                        TREE_TYPE (num),
+                                                        num, C));
     }
 
   finalize_stmt (new_stmt);
@@ -656,7 +658,7 @@ make_edge_and_fix_phis_of_dest (basic_block bb, edge e)
     {
       gimple phi = gsi_stmt (si);
       arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
-      add_phi_arg (phi, arg, new_e); 
+      add_phi_arg (phi, arg, new_e, gimple_phi_arg_location_from_edge (phi, e));
     }
 
   return new_e;
@@ -1291,6 +1293,8 @@ create_general_new_stmt (struct access_site *acc, tree new_type)
            {
              pos = find_pos_in_stmt (new_stmt, var);
              gcc_assert (pos);
+             /* ???  This misses adjustments to the type of the
+                INDIRECT_REF we possibly replace the operand of.  */
              *pos = new_var;
            }      
        }
@@ -2174,7 +2178,8 @@ create_new_var_1 (tree orig_decl, d_str str, new_var node)
       type = gen_struct_type (orig_decl, type); 
 
       if (is_global_var (orig_decl))
-       new_decl = build_decl (VAR_DECL, new_name, type); 
+       new_decl = build_decl (DECL_SOURCE_LOCATION (orig_decl),
+                              VAR_DECL, new_name, type); 
       else
        {
          const char *name = new_name ? IDENTIFIER_POINTER (new_name) : NULL;
@@ -3637,12 +3642,12 @@ do_reorg_1 (void)
   bitmap_obstack_initialize (NULL);
 
   for (node = cgraph_nodes; node; node = node->next)
-    if (node->analyzed && node->decl && !node->next_clone)
+    if (node->analyzed && node->decl)
       {
        push_cfun (DECL_STRUCT_FUNCTION (node->decl));
        current_function_decl = node->decl;
        if (dump_file)
-         fprintf (dump_file, "\nFunction to do reorg is  %s: \n",
+         fprintf (dump_file, "\nFunction to do reorg is %s: \n",
                   (const char *) IDENTIFIER_POINTER (DECL_NAME (node->decl)));
        do_reorg_for_func (node);
        free_dominance_info (CDI_DOMINATORS);
@@ -3805,8 +3810,7 @@ collect_data_accesses (void)
        {
          struct function *func = DECL_STRUCT_FUNCTION (c_node->decl);
 
-         if (!c_node->next_clone)
-           collect_accesses_in_func (func);
+         collect_accesses_in_func (func);
          exclude_alloc_and_field_accs (c_node);
        }
     }