I'm guessing this is almost certainly a bug in Compile (because they're fairly common), but it's pretty weird and I spent about an hour tracking down the issue and finding a test case. Consider this function, which is obviously contrived, but does what you'd expect:
f = Function[xs, Module[{i = 1}, While[i < Length@xs, With[{x = xs[[i]]}, If[x < 5.0, Break[], ++i]]]; i]]; f@Range[10.0, 1.0, -1.0] (* 7 *) OK, so my contrived function is not only contrived, it's also slow. I'll compile it so I can do useless things faster:
cf = Compile[{{xs, _Real, 1}}, Module[{i = 1}, While[i < Length@xs, With[{x = xs[[i]]}, If[x < 5.0, Break[], ++i]]]; i]]; cf@Range[10.0, 1.0, -1.0] (* Hold[Break[]] *) Oh, and I also got this rather goofy message:
Break::nofwd: No enclosing For, While, or Do found for Break[].
I can work around this by eliminating the With and substituting in by hand:
cf2 = Compile[{{xs, _Real, 1}}, Module[{i = 1}, While[i < Length@xs, If[xs[[i]] < 5.0, Break[], ++i]]; i]]; cf2@Range[10.0, 1.0, -1.0] (* 7 *)