From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5EF4C3858C52; Wed, 28 Feb 2024 14:36:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EF4C3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709130981; bh=ZxUf2AeGtXkUYrFDNbk7Gr0dXJyAeqw2TtXvXf2xgRg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=o4tIBpKwPvdkA8ZD9UNuH5hgZsvlWEtUiyMv3M1PzHylqoqeoWGxY5GFJ0YR/wnWU AXu0sbiG1f/7DNgvSx2qQ7/COA3gzD0Ss/4BcCyE1bx7XEPGkyGbYJVbJXNDz88I5Q mCL2zSBdEqqz3LslLc4Gd4eBBrYaJ+juEnz+NfuM= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114151] [14 Regression] weird and inefficient codegen and addressing modes since g:a0b1798042d033fd2cc2c806afbb77875dd2909b Date: Wed, 28 Feb 2024 14:36:21 +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: rguenth 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: 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=3D114151 --- Comment #2 from Richard Biener --- Yep, it seems to only pick up global ranges that way. diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc index 7cae5bdefea..626fc5bf5d7 100644 --- a/gcc/tree-ssa-loop-ivopts.cc +++ b/gcc/tree-ssa-loop-ivopts.cc @@ -132,6 +132,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-vectorizer.h" #include "dbgcnt.h" #include "cfganal.h" +#include "gimple-range.h" /* For lang_hooks.types.type_for_mode. */ #include "langhooks.h" @@ -8280,6 +8281,8 @@ tree_ssa_iv_optimize (void) tree_ssa_iv_optimize_init (&data); mark_ssa_maybe_undefs (); + enable_ranger (cfun); + /* Optimize the loops starting with the innermost ones. */ for (auto loop : loops_list (cfun, LI_FROM_INNERMOST)) { @@ -8292,6 +8295,8 @@ tree_ssa_iv_optimize (void) tree_ssa_iv_optimize_loop (&data, loop, toremove); } + disable_ranger (cfun); + /* Remove eliminated IV defs. */ release_defs_bitset (toremove);=