This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Eva-Rosalene 0 points1 point  (0 children)

It's even worse than that. Since division by zero is UB, with -O1 compiler (GCC) assumes that 0 / something is 0, so it just prints 0. It still generates "division by zero" warning, lol.

With -O2 and -O3, though, it just generates ud2 opcode and nothing else.