This is the mail archive of the
mailing list for the GCC project.
[pa] fix PR target/46512
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dave dot anglin at nrc-cnrc dot gc dot ca
- Date: Tue, 16 Nov 2010 20:41:54 -0500
- Subject: [pa] fix PR target/46512
FUNCTION_ARG_BOUNDARY was defined for pa as:
#define FUNCTION_ARG_BOUNDARY(MODE, TYPE) \
? (integer_zerop (TYPE_SIZE (TYPE)) \
|| !TREE_CONSTANT (TYPE_SIZE (TYPE)) \
|| int_size_in_bytes (TYPE) <= UNITS_PER_WORD) \
: GET_MODE_SIZE(MODE) <= UNITS_PER_WORD) \
? PARM_BOUNDARY : MAX_PARM_BOUNDARY)
When I hookized it, I tried to be clever and only access TYPE_SIZE once.
However, I was too clever, because I failed to notice that the TYPE_SIZE
calls were guarded by a check on whether type was non-NULL.
The patch below changes the hook to not do that. Sorry about the
breakage. Committed as obvious.
* config/pa/pa.c (pa_function_arg_boundary): Move TYPE_SIZE accesses
under check for type.
--- config/pa/pa.c (revision 166848)
+++ config/pa/pa.c (working copy)
@@ -9608,10 +9608,9 @@ pa_function_arg (CUMULATIVE_ARGS *cum, e
static unsigned int
pa_function_arg_boundary (enum machine_mode mode, const_tree type)
- tree size = TYPE_SIZE (type);
bool singleword = (type
- ? (integer_zerop (size)
- || !TREE_CONSTANT (size)
+ ? (integer_zerop (TYPE_SIZE (type))
+ || !TREE_CONSTANT (TYPE_SIZE (type))
|| int_size_in_bytes (type) <= UNITS_PER_WORD)
: GET_MODE_SIZE (mode) <= UNITS_PER_WORD);