OSDN Git Service

Patch to fix mips64-elf varargs aliasing failures.
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 Mar 1998 12:03:21 +0000 (12:03 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 9 Mar 1998 12:03:21 +0000 (12:03 +0000)
* function.c (put_reg_into_stack): Copy MEM_IN_STRUCT_P from new.
(assign_parms): Set aggregate if hide_last_arg and last_named.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18450 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/function.c

index 406cd47..53b0639 100644 (file)
@@ -1,3 +1,8 @@
+Mon Mar  9 12:02:23 1998  Jim Wilson  <wilson@cygnus.com>
+
+       * function.c (put_reg_into_stack): Copy MEM_IN_STRUCT_P from new.
+       (assign_parms): Set aggregate if hide_last_arg and last_named.
+
 Mon Mar  9 19:57:56 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * final.c (shorten_branches): Initialize insn_addresses.
index 5c3198f..192bc53 100644 (file)
@@ -1441,8 +1441,11 @@ put_reg_into_stack (function, reg, type, promoted_mode, decl_mode, volatile_p,
   PUT_CODE (reg, MEM);
 
   /* If this is a memory ref that contains aggregate components,
-     mark it as such for cse and loop optimize.  */
-  MEM_IN_STRUCT_P (reg) = AGGREGATE_TYPE_P (type);
+     mark it as such for cse and loop optimize.  If we are reusing a
+     previously generated stack slot, then we need to copy the bit in
+     case it was set for other reasons.  For instance, it is set for
+     __builtin_va_alist.  */
+  MEM_IN_STRUCT_P (reg) = AGGREGATE_TYPE_P (type) | MEM_IN_STRUCT_P (new);
 
   /* Now make sure that all refs to the variable, previously made
      when it was a register, are fixed up to be valid again.  */
@@ -3650,6 +3653,12 @@ assign_parms (fndecl, second_time)
 #else
       int named_arg = ! last_named;
 #endif
+      /* If this is a varargs function, then we want to treat the last named
+        argument as if it was an aggregate, because it might be accessed as
+        one by the va_arg macros.  This is necessary to make the aliasing
+        code handle this parm correctly.  */
+      if (hide_last_arg && last_named)
+       aggregate = 1;
 
       if (TREE_TYPE (parm) == error_mark_node
          /* This can happen after weird syntax errors