Note how this problem of "sufficient complexity" is an asymmetric problem between code author and compiler. A rather simple transformation implemented by the author to make the code constant-time may require NP-hard effort for the compiler to undo.
(but then the compiler may still do other unrelated transformations that end up making the code non-constant time again)