--- ./gdb/rs6000-aix-tdep.c_orig	2022-11-18 02:39:39 +0000
+++ ./gdb/rs6000-aix-tdep.c	2022-11-18 02:41:43 +0000
@@ -610,7 +610,15 @@
 	  gdb_byte word[PPC_MAX_REGISTER_SIZE];
 
 	  memset (word, 0, reg_size);
-	  memcpy (word, value_contents (arg), len);
+          if (type->code () == TYPE_CODE_INT
+             || type->code () == TYPE_CODE_ENUM
+             || type->code () == TYPE_CODE_BOOL
+             || type->code () == TYPE_CODE_CHAR)
+            /* Sign or zero extend the "int" into a "word".  */
+            store_unsigned_integer (word, reg_size, byte_order,
+                                   unpack_long (type, value_contents (arg)));
+          else
+            memcpy (word, value_contents (arg), len);
 	  regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
 	}
       ++argno;
