diff --git a/contrib/intarray/_int.h b/contrib/intarray/_int.h
index a52ec38ba4..0352cbd368 100644
--- a/contrib/intarray/_int.h
+++ b/contrib/intarray/_int.h
@@ -15,7 +15,7 @@
 									 ((GISTIntArrayOptions *) PG_GET_OPCLASS_OPTIONS())->num_ranges : \
 									 G_INT_NUMRANGES_DEFAULT)
 
-/* gist_int_ops opclass options */
+/* gist__int_ops opclass options */
 typedef struct
 {
 	int32		vl_len_;		/* varlena header (do not touch directly!) */
@@ -80,7 +80,7 @@ typedef char *BITVECP;
 #define HASHVAL(val, siglen) (((unsigned int)(val)) % SIGLENBIT(siglen))
 #define HASH(sign, val, siglen) SETBIT((sign), HASHVAL(val, siglen))
 
-/* gist_intbig_ops opclass options */
+/* gist__intbig_ops opclass options */
 typedef struct
 {
 	int32		vl_len_;		/* varlena header (do not touch directly!) */
diff --git a/src/backend/access/nbtree/nbtsplitloc.c b/src/backend/access/nbtree/nbtsplitloc.c
index ecb49bb471..43b67893d9 100644
--- a/src/backend/access/nbtree/nbtsplitloc.c
+++ b/src/backend/access/nbtree/nbtsplitloc.c
@@ -119,7 +119,7 @@ static inline IndexTuple _bt_split_firstright(FindSplitData *state,
  * righthand page (which is called firstrightoff), plus a boolean
  * indicating whether the new tuple goes on the left or right page.  You
  * can think of the returned state as a point _between_ two adjacent data
- * items (laftleft and firstright data items) on an imaginary version of
+ * items (lastleft and firstright data items) on an imaginary version of
  * origpage that already includes newitem.  The bool is necessary to
  * disambiguate the case where firstrightoff == newitemoff (i.e. it is
  * sometimes needed to determine if the firstright tuple for the split is
diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c
index 864e35e45b..5f7ee23886 100644
--- a/src/backend/commands/opclasscmds.c
+++ b/src/backend/commands/opclasscmds.c
@@ -819,7 +819,7 @@ AlterOpFamily(AlterOpFamilyStmt *stmt)
 	Oid			amoid,			/* our AM's oid */
 				opfamilyoid;	/* oid of opfamily */
 	int			maxOpNumber,	/* amstrategies value */
-				optsProcNumber, /* amopclassopts value */
+				optsProcNumber, /* amoptsprocnum value */
 				maxProcNumber;	/* amsupport value */
 	HeapTuple	tup;
 	Form_pg_am	amform;
@@ -1321,7 +1321,7 @@ assignProcTypes(OpFamilyMember *member, Oid amoid, Oid typeoid,
 			/*
 			 * pg_amproc functions are indexed by (lefttype, righttype), but
 			 * an equalimage function can only be called at CREATE INDEX time.
-			 * The same opclass opcintype OID is always used for leftype and
+			 * The same opclass opcintype OID is always used for lefttype and
 			 * righttype.  Providing a cross-type routine isn't sensible.
 			 * Reject cross-type ALTER OPERATOR FAMILY ...  ADD FUNCTION 4
 			 * statements here.
diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c
index daefe66f40..cc6e4a8575 100644
--- a/src/backend/jit/llvm/llvmjit_expr.c
+++ b/src/backend/jit/llvm/llvmjit_expr.c
@@ -2121,8 +2121,8 @@ llvm_compile_expr(ExprState *state)
 
 					/*
 					 * pergroup = &aggstate->all_pergroups
-					 * [op->d.agg_strict_trans_check.setoff]
-					 * [op->d.agg_init_trans_check.transno];
+					 * [op->d.agg_trans.setoff]
+					 * [op->d.agg_trans.transno];
 					 */
 					v_allpergroupsp =
 						l_load_struct_gep(b, v_aggstatep,
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index d2ec396045..59347ab951 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -135,7 +135,7 @@ static const char *const BuiltinTrancheNames[] = {
 	/* LWTRANCHE_XACT_BUFFER: */
 	"XactBuffer",
 	/* LWTRANCHE_COMMITTS_BUFFER: */
-	"CommitTSBuffer",
+	"CommitTsBuffer",
 	/* LWTRANCHE_SUBTRANS_BUFFER: */
 	"SubtransBuffer",
 	/* LWTRANCHE_MULTIXACTOFFSET_BUFFER: */
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index 51df570ce9..f0b6567da1 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -1012,7 +1012,7 @@ search_locale_enum(LPWSTR pStr, DWORD dwFlags, LPARAM lparam)
 	{
 		/*
 		 * If the enumerated locale does not have a hyphen ("en") OR the
-		 * lc_message input does not have an underscore ("English"), we only
+		 * locale_name input does not have an underscore ("English"), we only
 		 * need to compare the <Language> tags.
 		 */
 		if (wcsrchr(pStr, '-') == NULL || wcsrchr(argv[0], '_') == NULL)
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index d7d9c1bee3..3f343fff16 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -2109,7 +2109,7 @@ plperl_create_sub(plperl_proc_desc *prodesc, const char *s, Oid fn_oid)
 	/*
 	 * G_KEEPERR seems to be needed here, else we don't recognize compile
 	 * errors properly.  Perhaps it's because there's another level of eval
-	 * inside mksafefunc?
+	 * inside mkfunc?
 	 */
 	count = call_pv("PostgreSQL::InServer::mkfunc",
 					G_SCALAR | G_EVAL | G_KEEPERR);
