PATCH: Fix for compile/20010605-1.c on PA
John David Anglin
dave@hiauly1.hia.nrc.ca
Fri Aug 17 08:57:00 GMT 2001
The enclosed patch fixes the failure of compile/20010605-1.c on the PA.
The RETURN_IN_MEMORY macro wasn't correctly testing for the case where
int_size_in_bytes returns -1. This can happen when TYPE is a SAVE_EXPR
with variable size.
The are probably other places in pa.c and pa.h where similar tests
should be done with the return of int_size_in_bytes. However, passing
a SAVE_EXPR to a nested function seems to be seriously broken, so I
haven't been able to fully test a similar change for function parameters.
Bootstrap tested with no regressions on both main and branch on
hppa1.1-hp-hpux10.20.
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2001-08-10 John David Anglin <dave@hiauly1.hia.nrc.ca>
* pa.h (RETURN_IN_MEMORY): Return types with a size that is varable
or larger than an integer in memory.
--- pa.h.orig Fri Jul 13 22:39:39 2001
+++ pa.h Fri Aug 10 16:41:14 2001
@@ -518,9 +518,11 @@
#define DEFAULT_PCC_STRUCT_RETURN 0
/* SOM ABI says that objects larger than 64 bits are returned in memory.
- PA64 ABI says that objects larger than 128 bits are returned in memory. */
+ PA64 ABI says that objects larger than 128 bits are returned in memory.
+ Note that int_size_in_bytes can return -1 if the size is variable
+ or larger than an integer. */
#define RETURN_IN_MEMORY(TYPE) \
- (TARGET_64BIT ? int_size_in_bytes (TYPE) > 16 : int_size_in_bytes (TYPE) > 8)
+ ((unsigned HOST_WIDE_INT) int_size_in_bytes (TYPE) > (TARGET_64BIT ? 16 : 8))
/* Register in which address to store a structure value
is passed to a function. */
More information about the Gcc-patches
mailing list