do not optimize while into do-while if there are continues; fixes #1337