aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1998-03-09 12:03:21 +0000
committerJim Wilson <wilson@gcc.gnu.org>1998-03-09 04:03:21 -0800
commitbdd3e6abedb77356422ad57820d0c81ee117f800 (patch)
tree8a7b7471471c33305b3352c302c6f8a391133159 /gcc/function.c
parent25938114e3005a99cc21c9e3bf1c3ca4d1b6bb23 (diff)
downloadgcc-bdd3e6abedb77356422ad57820d0c81ee117f800.zip
gcc-bdd3e6abedb77356422ad57820d0c81ee117f800.tar.gz
gcc-bdd3e6abedb77356422ad57820d0c81ee117f800.tar.bz2
Patch to fix mips64-elf varargs aliasing failures.
* function.c (put_reg_into_stack): Copy MEM_IN_STRUCT_P from new. (assign_parms): Set aggregate if hide_last_arg and last_named. From-SVN: r18450
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 5c3198f..192bc53 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -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