From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 437EB3858D28; Thu, 31 Aug 2023 13:22:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 437EB3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693488162; bh=4QLCouhWb+bXMuVzYJ2NK45SgTZS2bBHHQTCjJbbsig=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uiQjVNVw+g4Gk4VhI0WU6vnDrhEpLFmSjj7RVCVBtPqZN/70zP0mODWnaT5FY0Hep EQtEovpkD/ZMkgnPEmiJrYBCf3dzXlwqyarRH01vbdCTcAoxOAn1aaSzen9egljmjI V0XhqH+ECWFzxRdr7doYkMY39S4EtM8gV7wGsyus= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/111257] new signed overflow after vectorizer Date: Thu, 31 Aug 2023 13:22:41 +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, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed bug_status cf_reconfirmed_on assigned_to keywords 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=3D111257 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2023-08-31 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org Keywords| |missed-optimization, | |wrong-code --- Comment #1 from Richard Biener --- Yeah, we modify a copy of the scalar loop in-place, only removing original stmts that have side-effects, leaving dead code elimination to the followup= DCE pass. Note we run that immediately after loop vectorization but for SLP vectorization there are quite some intermediate passes until we perform DCE, for example there's IVOPTS which might re-compute number of iterations and at least max_iteration estimate also looks at undefined behavior. OTOH with SLP vectorization we don't change any loop iteration which means the original stmts only compute the very original values (should, at least). That means there might be an actual issue for those cases but for loop vectorization the issue should be moot unless those stmts survive the DCE pass after it. I would suggest to "blacklist" analyzing the "vect" dump, the followup "dce" dump should be fine. For SLP I'm not sure, I guess no actual problems should show up but we should maybe try to use simple_dce_from_worklist with the root stmts original SSA uses (and defs in some cases), possibly the root stmt vectorization code generation code could gather relevant defs. So I think, correctness wise it should be a non-issue but it's a bit ugly also since some fuzzers like to disable DCE which then indeed would create wrong-code issues.=