Compile::cret
The tensor rank of the return value will be different depending on the value of the argument:
Compile[{p}, If[p > 0, Return[1]];{2}]Compilation proceeds without difficulty if all of the return values have the same tensor rank:
Compile[{p}, If[p > 0, Return[{1}]];{2}]