diff --git a/src/backend/access/spgist/spgdoinsert.c b/src/backend/access/spgist/spgdoinsert.c
index f090ca5..ff986c2 100644
--- a/src/backend/access/spgist/spgdoinsert.c
+++ b/src/backend/access/spgist/spgdoinsert.c
@@ -1871,6 +1871,10 @@ spgdoinsert(Relation index, SpGistState *state,
 	SPPageDesc	current,
 				parent;
 	FmgrInfo   *procinfo = NULL;
+	SpGistInnerTuple innerTuple;
+	spgChooseIn in;
+	spgChooseOut out;
+
 
 	/*
 	 * Look up FmgrInfo of the user-defined choose function once, to save
@@ -2044,9 +2048,6 @@ spgdoinsert(Relation index, SpGistState *state,
 			 * Apply the opclass choose function to figure out how to insert
 			 * the given datum into the current inner tuple.
 			 */
-			SpGistInnerTuple innerTuple;
-			spgChooseIn in;
-			spgChooseOut out;
 
 			/*
 			 * spgAddNode and spgSplitTuple cases will loop back to here to
