On Sun, 2022-01-23 at 09:56 +0000, Vishal Subramanyam wrote: > This still doesn't explain why an O1 level optimization can violate > the standard by not evaluating the first operand. It's not violating the standard. The standard says division-by-zero is an undefined behavior, so the compiler can do anything. > What optimization is my code triggering with -fno-inline? My function > clearly has a return value, so how did the compiler > decide that the return value doesn't matter? -- Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx> School of Aerospace Science and Technology, Xidian University