diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2f5a5a3ff3ff5b30f2e1a640daab19b4c1990066..4b8c9a16e5aaab9ee583d7d593d46a43a15a52d1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-16  Nathan Froyd  <froydnj@codesourcery.com>
+
+	PR target/46512
+	* config/pa/pa.c (pa_function_arg_boundary): Move TYPE_SIZE accesses
+	under check for type.
+
 2010-11-16  Eric Botcazou  <ebotcazou@adacore.com>
 
 	* ifcvt.c (dead_or_predicable): Fix typo.
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 366ce015bcf8e2b705b1a64c3eab42d94ba0f0eb..57858a7061a12e7c1bfa658bd8c7d0c880a8274a 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -9608,10 +9608,9 @@ pa_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
 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);