From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C13A63853D02; Thu, 31 Aug 2023 09:12:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C13A63853D02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693473150; bh=Gt5OpPQCddbGwqcwjBCpzFK+b9npCD1W1VSdm45hA4E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=e0YDYuop4WmSYQ4HgbWV88i7Iio0MXJkKyxzRFz75M+846f+dzhuoUo8kJi9NdQZm Z5dRyeMJiJ8fZ0z2EFioe/+zPHbpSDLSdOs37Qt5/72VBgnud6vOtnW5sQ78g3aX37 jYd7xHsBkLp32AfRdLRRnuXB/ajm1uaxVN+gVYyg= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/111256] Wrong code at -O2/3/s since r10-1615-g75efe9cb1f8 Date: Thu, 31 Aug 2023 09:12:30 +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: xry111 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: cc resolution bug_status 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=3D111256 Xi Ruoyao changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xry111 at gcc dot gnu.org Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #1 from Xi Ruoyao --- In the 2nd iteration of "for (; h <=3D 3; h =3D fn3() + h)" the code uses uninitialized value: $ clang t.c -O0 -fsanitize=3Dmemory -g $ ./a.out=20 =3D=3D76055=3D=3DWARNING: MemorySanitizer: use-of-uninitialized-value #0 0x56392dea5370 in main /home/xry111/t.c:31:5 #1 0x7f9671e27f59 in __libc_start_call_main /home/xry111/sources/lfs/glibc-2.38/csu/../sysdeps/nptl/libc_start_call_mai= n.h:58:16 #2 0x7f9671e28024 in __libc_start_main@GLIBC_2.2.5 /home/xry111/sources/lfs/glibc-2.38/csu/../csu/libc-start.c:360:3 #3 0x56392de0f2d0 in _start /home/xry111/sources/lfs/glibc-2.38/csu/../sysdeps/x86_64/start.S:115 SUMMARY: MemorySanitizer: use-of-uninitialized-value /home/xry111/t.c:31:5 = in main Exiting Thus invalid.=