From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 564493858C39; Tue, 10 Oct 2023 01:51:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 564493858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696902661; bh=jyBDugDF5LNVXtCENQ46BZBHEwSEvNNxK0LnTDi805k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bZ/kuIAeygtA9op/TtBF3HeuOt5ZHM/dak8i5z5WJzlKEPKZX7Hr0kei+p/4FyDDy YmfQIEfDpNG9NRWUWpFfYcWjz9rf32gkg98waGaEis0uEd+xjqVd0GiNl9DllhnVKe eDM8xlnpUT+L9CZXgABGAVHpeeLRl+hv388n4oQs= From: "iamanonymous.cs at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111738] incorrect code when PGO is enabled Date: Tue, 10 Oct 2023 01:50:54 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iamanonymous.cs at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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=3D111738 --- Comment #3 from Anonymous --- (In reply to Richard Biener from comment #1) > I can't reproduce. Your git version is quite old, it translates to > r14-2634-g85da0b40538fb0 for me. It doesn't reproduce with r14-2282 eith= er > though. >=20 > Current is r14-4486-g873586ebc565b6 Hi, Richard. According to your suggestion, we have updated our gcc to the latest trunk as: $ gcc -v Using built-in specs. COLLECT_GCC=3D/root/gcc_set/202310092007/bin/gcc COLLECT_LTO_WRAPPER=3D/root/gcc_set/202310092007/libexec/gcc/x86_64-pc-linu= x-gnu/14.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --prefix=3D/root/gcc_set/202310092007 --with-gmp=3D/root/build_essential --with-mpfr=3D/root/build_essential --with-mpc=3D/root/build_essential --enable-languages=3Dc,c++ --disable-mul= tilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 20231009 (experimental) (GCC) git version: dee55cf59ceea989f47e7605205c6644b27a1f78 Then, we compiled the same test program with/without PGO enabled and found = that the results are inconsistent as: $ gcc -O3 -w -fprofile-generate=3Dprofile a.c -o a.out $ ./a.out 4 $ gcc -O3 -w -fprofile-use=3Dprofile -Wno-missing-profile -fprofile-correct= ion a.c -o a.out $ ./a.out 32765=