It does not make sense to compel someone to confess, because that presumes the person is guilty. But it may make sense to compel someone to share factual information ("the PIN is 1234") or to provide access to information.
> But it may make sense to compel someone to share factual information ("the PIN is 1234") or to provide access to information.
No, it does not, because "compel" means that if they do not comply you punish them until they do.
How are you to know whether or not they actually remember the information you are asking ("The PIN was, err .. 1235?"). This leads to effectively punishing them for not giving the "correct" answer, which is no different from punishing them for not confessing.
Once you go down the path of punishing people for not divulging the contents of their mind, you may well just punish them for the crime itself and not bother with a trial.
If you allow compelled speech, there is no reason to have a trial.
If a court can compel speech, then they may as well go ahead and compel the suspect to confess.
There's no difference, once the courts compel speech.