I just tried the C version and it compiles and exits gracefully with gcc 4.2.1.
int main(int argc, char *argv[]) { return (1LL << 63) / atoi(argv[1]); }
Note that this issue has been written about before by Tavis Ormandy: http://my.opera.com/taviso/blog/show.dml/639454Also, what optimization level did you run with?
define i64 @crash() nounwind uwtable readnone optsize {
ret i64 undef
}
In machine code terms, on x86-64 this turns into a function composed entirely of the ret opcode. gcc-4.6 adds an xor eax, eax before the ret.