OSDN Git Service

* gcc.dg/graphite/pr38409.c: Fixed commit problem.
[pf3gnuchains/gcc-fork.git] / gcc / function.c
index 41c5a46..29fe1b0 100644 (file)
@@ -1634,7 +1634,7 @@ instantiate_decls_1 (tree let)
 static void
 instantiate_decls (tree fndecl)
 {
-  tree decl;
+  tree decl, t, next;
 
   /* Process all parameters of the function.  */
   for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl))
@@ -1650,6 +1650,17 @@ instantiate_decls (tree fndecl)
 
   /* Now process all variables defined in the function or its subblocks.  */
   instantiate_decls_1 (DECL_INITIAL (fndecl));
+
+  t = cfun->local_decls;
+  cfun->local_decls = NULL_TREE;
+  for (; t; t = next)
+    {
+      next = TREE_CHAIN (t);
+      decl = TREE_VALUE (t);
+      if (DECL_RTL_SET_P (decl))
+       instantiate_decl_rtl (DECL_RTL (decl));
+      ggc_free (t);
+    }
 }
 
 /* Pass through the INSNS of function FNDECL and convert virtual register
@@ -1755,7 +1766,9 @@ aggregate_value_p (const_tree exp, const_tree fntype)
       {
       case CALL_EXPR:
        fndecl = get_callee_fndecl (fntype);
-       fntype = fndecl ? TREE_TYPE (fndecl) : 0;
+       fntype = (fndecl
+                 ? TREE_TYPE (fndecl)
+                 : TREE_TYPE (CALL_EXPR_FN (fntype)));
        break;
       case FUNCTION_DECL:
        fndecl = fntype;
@@ -2325,7 +2338,17 @@ assign_parm_find_stack_rtl (tree parm, struct assign_parm_data_one *data)
      while promoted mode's size is needed.  */
   if (data->promoted_mode != BLKmode
       && data->promoted_mode != DECL_MODE (parm))
-    set_mem_size (stack_parm, GEN_INT (GET_MODE_SIZE (data->promoted_mode)));
+    {
+      set_mem_size (stack_parm, GEN_INT (GET_MODE_SIZE (data->promoted_mode)));
+      if (MEM_EXPR (stack_parm) && MEM_OFFSET (stack_parm))
+       {
+         int offset = subreg_lowpart_offset (DECL_MODE (parm),
+                                             data->promoted_mode);
+         if (offset)
+           set_mem_offset (stack_parm,
+                           plus_constant (MEM_OFFSET (stack_parm), -offset));
+       }
+    }
 
   boundary = data->locate.boundary;
   align = BITS_PER_UNIT;
@@ -2425,7 +2448,7 @@ assign_parm_remove_parallels (struct assign_parm_data_one *data)
   if (GET_CODE (entry_parm) == PARALLEL && GET_MODE (entry_parm) != BLKmode)
     {
       rtx parmreg = gen_reg_rtx (GET_MODE (entry_parm));
-      emit_group_store (parmreg, entry_parm, NULL_TREE,
+      emit_group_store (parmreg, entry_parm, data->passed_type,
                        GET_MODE_SIZE (GET_MODE (entry_parm)));
       entry_parm = parmreg;
     }
@@ -3254,6 +3277,14 @@ gimplify_parameters (void)
                {
                  local = create_tmp_var (type, get_name (parm));
                  DECL_IGNORED_P (local) = 0;
+                 /* If PARM was addressable, move that flag over
+                    to the local copy, as its address will be taken,
+                    not the PARMs.  */
+                 if (TREE_ADDRESSABLE (parm))
+                   {
+                     TREE_ADDRESSABLE (parm) = 0;
+                     TREE_ADDRESSABLE (local) = 1;
+                   }
                }
              else
                {
@@ -3462,6 +3493,10 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs,
 
   locate->size.constant -= part_size_in_regs;
 #endif /* ARGS_GROW_DOWNWARD */
+
+#ifdef FUNCTION_ARG_OFFSET
+  locate->offset.constant += FUNCTION_ARG_OFFSET (passed_mode, type);
+#endif
 }
 
 /* Round the stack offset in *OFFSET_PTR up to a multiple of BOUNDARY.
@@ -3954,6 +3989,8 @@ allocate_struct_function (tree fndecl, bool abstract_p)
   OVERRIDE_ABI_FORMAT (fndecl);
 #endif
 
+  invoke_set_current_function_hook (fndecl);
+
   if (fndecl != NULL_TREE)
     {
       DECL_STRUCT_FUNCTION (fndecl) = cfun;
@@ -3979,8 +4016,6 @@ allocate_struct_function (tree fndecl, bool abstract_p)
       cfun->va_list_gpr_size = VA_LIST_MAX_GPR_SIZE;
       cfun->va_list_fpr_size = VA_LIST_MAX_FPR_SIZE;
     }
-
-  invoke_set_current_function_hook (fndecl);
 }
 
 /* This is like allocate_struct_function, but pushes a new cfun for FNDECL