This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix part of target/6103
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 3 Apr 2002 15:52:40 +0200
- Subject: [PATCH] Fix part of target/6103
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
target/6103 lists 4 different failing testcases.
This patch fixes the first one, va-arg-22.c at -m64.
The problem is that SPARC v9 ABI mandates all structures <= 8 bytes
to be given one 8 byte slot, while va_arg was not incrementing va_list
for zero-sized structures at all (but caller reserved the slot).
When not using stdarg, passing zero sized structures always eats one
register or one stack slot as mandated by the ABI.
Will commit this after testing together with other fixes.
2002-04-03 Jakub Jelinek <jakub@redhat.com>
* config/sparc/sparc.c (sparc_va_arg): Adjust va_list by
UNITS_PER_WORD for zero sized aggregates.
--- gcc/config/sparc/sparc.c.jj Sun Mar 31 20:44:46 2002
+++ gcc/config/sparc/sparc.c Wed Apr 3 15:43:07 2002
@@ -4950,6 +4950,10 @@ sparc_va_arg (valist, type)
indirect = 1;
size = rsize = UNITS_PER_WORD;
}
+ /* SPARC v9 ABI sais structures up to 8 bytes in size are given
+ one 8 byte slot. */
+ else if (size == 0)
+ size = rsize = UNITS_PER_WORD;
else
size = rsize;
}
Jakub