[Bug c/112550] Difference in output from -O0 to -01 ?

dcb314 at hotmail dot com gcc-bugzilla@gcc.gnu.org
Wed Nov 15 16:59:54 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112550

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Sam James from comment #1)
> Not sure if I'm misunderstanding you, but it's not trivial to go from -O0
> and -O1 and it's "normal" to have a difference in output in either the case
> of: a) UB, or b) a compiler bug (miscompilation).

The source code I provided is produced by csmith and then preprocessed.

I tried the upstream unpreprocessed source code on clang -O0 and gcc -O0
and they agreed on the output, so it looked to me like csmith was working ok.

Only when I changed over from gcc -O0 to gcc -O1 did I see a difference.


More information about the Gcc-bugs mailing list