diff --git a/z_spm.c b/z_spm.c
index 9f27635a133f6d2b5ae48f14ff027d7950647d96..cf1806a4ce04ac4376ba5097a3345b97a9955a62 100644
--- a/z_spm.c
+++ b/z_spm.c
@@ -126,7 +126,6 @@ z_spmMergeDuplicate( pastix_spm_t *spm )
     pastix_int_t dof2    = spm->dof * spm->dof;
     pastix_int_t idx, i, j, d, size;
     pastix_int_t merge = 0;
-    (void)d;
 
     if ( spm->fmttype == PastixCSC ) {
         idx = 0;
@@ -180,6 +179,7 @@ z_spmMergeDuplicate( pastix_spm_t *spm )
         }
     }
 
+    (void)d;
     return merge;
 }