From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0F1873858C83; Tue, 15 Feb 2022 23:21:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0F1873858C83 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/104551] [12 Regression] Wrong code with -O3 for skylake-avx512, icelake-server, and sapphirerapids Date: Tue, 15 Feb 2022 23:21:13 +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: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status short_desc target_milestone everconfirmed cf_reconfirmed_on 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: Tue, 15 Feb 2022 23:21:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104551 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Summary|Wrong code with -O3 for |[12 Regression] Wrong code |skylake-avx512, |with -O3 for |icelake-server, and |skylake-avx512, |sapphirerapids |icelake-server, and | |sapphirerapids Target Milestone|--- |12.0 Ever confirmed|0 |1 Last reconfirmed| |2022-02-15 --- Comment #1 from Andrew Pinski --- Confirmed, single file version: unsigned int var_11 =3D 16U; unsigned int var_178 =3D 0; unsigned char arr_492 [128]; [[gnu::noipa]] void test() { for (bool a =3D 0; a < (bool)var_11; a =3D 2) for (unsigned b =3D 0; b < var_11; b +=3D 1) var_178 =3D arr_492[b] ? arr_492[b] : (char) b; } int main() { for (int i =3D 0; i < 128; ++i) arr_492 [i] =3D (unsigned char)128; test(); __builtin_printf("%u\n", var_178); if (var_178 !=3D 128) __builtin_abort(); return 0; } ----- CUT ----- I increasing the array size to 128 allowed me to merge it, I don't know why though; maybe because it allowed the code to be vectorize while 16 was not going to.=