diff mbox

[pa] fix PR target/46512

Message ID 20101117014153.GR24469@nightcrawler
State New
Headers show

Commit Message

Nathan Froyd Nov. 17, 2010, 1:41 a.m. UTC
FUNCTION_ARG_BOUNDARY was defined for pa as:

#define FUNCTION_ARG_BOUNDARY(MODE, TYPE)				\
  (((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.

-Nathan

	PR target/46512
	* config/pa/pa.c (pa_function_arg_boundary): Move TYPE_SIZE accesses
	under check for type.
diff mbox

Patch

Index: config/pa/pa.c
===================================================================
--- 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);