Hacker News new | ask | show | jobs
by lauraura 4371 days ago
Your arithmetic is being optimized out by the compiler; https://ideone.com/KmTSUB crashes for example.
1 comments

Looks like you're right (re my sibling comment above):

    $ gcc -std=c99 -S intmin.c -o intmin.s
    $ clang -std=c99 -S intmin.c -o intmin.sc
    $ grep -i div intmin.s*
    intmin.sc:      idivl   %esi
(No idivl in the gcc version)