From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C5A063855020; Sat, 10 Jul 2021 19:33:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C5A063855020 From: "zsojka at seznam dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101403] [12 Regression] wrong code with __builtin_bswap16() at -O1 by r12-2137 Date: Sat, 10 Jul 2021 19:33:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: zsojka at seznam dot cz X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: roger at nextmovesoftware dot com X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jul 2021 19:33:39 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101403 --- Comment #5 from Zdenek Sojka --- (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=3Dundefined when reducing testcases, but this one was= n'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.=