 
         // comunicate the global position of the match to other threads
         match_location = __shfl_sync(0xffffffff, match_location, first_match_thread);
+      } else {
+        first_match_thread = COMP_THREADS;
       }
 
       // only go to the hash table, if there is a possibility of a finding an


      // first try to find a local match
      position_type match_location = length;
      int first_match_thread = -1;
      int match_mask_self = 0;
      if (threadIdx.x < numValidThreads) {
        match_mask_self = warpMatchAny(numValidThreadsToMask(numValidThreads), next);

      const int match_mask_warp = warpBallot(
          match_mask_self && __clz(__brev(match_mask_self)) != threadIdx.x);

      int first_match_thread;
      if (match_mask_warp) {
        // find the byte offset (thread id) within the warp where the first
        // match is located
