A little query about __syncthreads()

Lets say every thread of a thread block is running a loop. I am using __syncthreads() in the loop. Assume after some steps, some of the threads break the loop and come out but rest threads will face __syncthreads() again. Will it give error? If not then please tell me what will the answer.

It will not give you an error (how would you expect such an error to be reported?), but the result is undefined, because the would amount to __syncthreads() within nonuniform control flow.

Thanks @Tera. Error, I meant to say control flows will be different for all loop breaking threads. The non loop breaking threads will wait for the loop breaking threads when they face __syncthreads() for next step and hang forever.