diff --git a/src/backend/storage/page/itemptr.c b/src/backend/storage/page/itemptr.c
index c9918289691718775777b893ab65ec536cb43d31..244d8fba2f62a6508d0003573d3c1b5ed6467bc9 100644
--- a/src/backend/storage/page/itemptr.c
+++ b/src/backend/storage/page/itemptr.c
@@ -28,6 +28,13 @@
 bool
 ItemPointerEquals(ItemPointer pointer1, ItemPointer pointer2)
 {
+	/*
+	 * We really want ItemPointerData to be exactly 6 bytes.  This is rather a
+	 * random place to check, but there is no better place.
+	 */
+	StaticAssertStmt(sizeof(ItemPointerData) == 3 * sizeof(uint16),
+					 "ItemPointerData struct is improperly padded");
+
 	if (ItemPointerGetBlockNumber(pointer1) ==
 		ItemPointerGetBlockNumber(pointer2) &&
 		ItemPointerGetOffsetNumber(pointer1) ==
diff --git a/src/include/storage/itemptr.h b/src/include/storage/itemptr.h
index eb06c794d2b2fadd0e5e94ed4ab959eba422b90b..60e76e9ffa0c42ac4924d31ca6c11499f72bb64a 100644
--- a/src/include/storage/itemptr.h
+++ b/src/include/storage/itemptr.h
@@ -39,9 +39,10 @@ typedef struct ItemPointerData
 	BlockIdData ip_blkid;
 	OffsetNumber ip_posid;
 }
-
-#ifdef __arm__
-pg_attribute_packed()			/* Appropriate whack upside the head for ARM */
+/* If compiler understands packed and aligned pragmas, use those */
+#if defined(pg_attribute_packed) && defined(pg_attribute_aligned)
+pg_attribute_packed()
+pg_attribute_aligned(2)
 #endif
 ItemPointerData;