This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[pa] fix PR target/46512

FUNCTION_ARG_BOUNDARY was defined for pa as:

  (((TYPE)								\
    ? (integer_zerop (TYPE_SIZE (TYPE))					\
       || !TREE_CONSTANT (TYPE_SIZE (TYPE))				\
       || int_size_in_bytes (TYPE) <= UNITS_PER_WORD)			\

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.


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

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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]