From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E3D63939C23; Fri, 18 Dec 2020 20:03:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E3D63939C23 From: "vsevolod.livinskij at frtk dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98381] New: Wrong code with -O3 -march=skylake-avx512 Date: Fri, 18 Dec 2020 20:03:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vsevolod.livinskij at frtk dot ru 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Fri, 18 Dec 2020 20:03:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98381 Bug ID: 98381 Summary: Wrong code with -O3 -march=3Dskylake-avx512 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: vsevolod.livinskij at frtk dot ru Target Milestone: --- Reproducer: //func.cpp extern bool var_22; void test(long long a, unsigned b, unsigned long long c) { for (long i =3D 0; i < 16; i +=3D 1ULL) if (a) var_22 =3D 5023804122334ULL >=3D (char)c; } //driver.cpp=20 #include long long int a =3D -2161098602020439353LL; unsigned int b =3D 1621447385U; unsigned long long int c =3D 16505450185101189749ULL; bool var_22 =3D (bool)0; void test(long long int a, unsigned int b, unsigned long long int c); int main() { test(a, b, c); printf("%d\n", (int)var_22); } Error: >$ g++ -O3 -march=3Dskylake-avx512 func.cpp driver.cpp && sde -skx -- ./a.o= ut 0 >$ g++ -O0 func.cpp driver.cpp && sde -skx -- ./a.out 1 gcc version 11.0.0 20201217 (6f8486523f61bf0aa476dfa4197d1e3b71a0a8f3) (GCC= )=