https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70018
--- Comment #4 from Sanjoy Das <sanjoy at playingwithpointers dot com> --- (In reply to Andrew Pinski from comment #2) > So in summary what you are seeing is two effects going into effect here: > undefined behavior of division by 0 and ODR. There is no division by zero (or any other UB that I'm aware of) in the original program.