From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 58D123858D35; Fri, 27 Oct 2023 05:17:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58D123858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698383876; bh=nMgZwJ69BlwUXohs3yB4c/DQ0sUQyH/jVlAxKOexteQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FgZdX+KAAHFKr8xbHhkeHnaIvzgsjhY1QN8XuG/3Bl9rXbysvfdn8QIMia2w0XfJB j8k3eWJyrELWfa6xwOOE0WYDTW4Vj7etTr4ZQaH0CURENM28mlVx6gKE2svoPzNvMe 8eM6R4bJUzyBkR/17rcDZ4mS6uL7rb018r9JYvak= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111972] [14 regression] missed vectorzation for bool a = j != 1; j = (long int)a; Date: Fri, 27 Oct 2023 05:17:56 +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: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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=3D111972 --- Comment #7 from Hongtao.liu --- (In reply to Andrew Pinski from comment #3) > First off does this even make sense to vectorize but rather do some kind = of > scalar reduction with respect to j =3D j^1 here . Filed PR 112104 for t= hat. >=20 > Basically vectorizing this loop is a waste compared to that. Yes, it's always zero, it would be nice if the middle end can optimize the whole loop off. So for this PR, it's more related to the misoptimization of= the redundant loop(better finalize the induction variable with a simple assignment), not vectorization.=