From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2700B3858D38; Mon, 28 Aug 2023 12:55:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2700B3858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693227358; bh=3k3Klx/JuwfF/nBUMb7NEpb8KBwO3JdhepRZQ80rmRw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=P0b3ezIwNGza2PBs9NvBicR84JktOTVzFzHnLSK78IzmppfeuVPyzYBQkkU7Nvi8V c4AVtSKMa4+JCReJp7HTNgqJLAgTp64oDlPdl11a3nZK9rXPCDGC6MHapJcDjeZADS 9KTsG1jYkT8GHM6XcDO6EY02tQ4sezasVey4p0nI= From: "amonakov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111210] Wrong code at -Os on x86_64-linux-gnu since r12-4849-gf19791565d7 Date: Mon, 28 Aug 2023 12:55:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: amonakov at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111210 --- Comment #4 from Alexander Monakov --- The testcase is small enough to notice the issue by inspection. Note that you get the "expected" answer with -fno-strict-aliasing, and as explained in https://gcc.gnu.org/bugs/ it is one of the things you should c= heck when submitting a bugreport: Before reporting that GCC compiles your code incorrectly, compile it with g= cc -Wall -Wextra and see whether this shows anything wrong with your code. Similarly, if compiling with -fno-strict-aliasing -fwrapv -fno-aggressive-loop-optimizations makes a difference, or if compiling with -fsanitize=3Dundefined produces any run-time errors, then your code is prob= ably not correct.=