https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120948
--- Comment #2 from huyubiao <h13958451065 at 163 dot com> --- (In reply to Richard Biener from comment #1) > So you say that we fail to optimize > > int foo (unsigned x) > { > unsigned tem = 1/x; > if (x == 0) > return 5; > return tem; > } > > because we turn 1/x into x == 1? > > A phase ordering issue, obviously. Relevant in practice? I'm not sure. I believe such non-compliant code makes maintenance troubleshooting significantly harder. Could we implement a compiler warning when x=0 potentially occurs?