[Bug tree-optimization/101403] [12 Regression] wrong code with __builtin_bswap16() at -O1 by r12-2137

zsojka at seznam dot cz gcc-bugzilla@gcc.gnu.org
Sat Jul 10 19:33:39 GMT 2021


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

--- Comment #5 from Zdenek Sojka <zsojka at seznam dot cz> ---
(In reply to Jakub Jelinek from comment #4)
> Isn't the testcase UB? It reads uninitialized u (though it doesn't use the
> value for anything).

You are very right about that! The value is used, even though the use is
optimised out.
I am using -fsanitize=undefined when reducing testcases, but this one wasn't
caught. The only warning I see with -Wall -W is "warning: left-hand operand of
comma expression has no effect [-Wunused-value]". valgrind also doesn't
complain because, obviously, the uninitialised read is optimised out.


More information about the Gcc-bugs mailing list