From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 698E7385741C; Mon, 16 Aug 2021 08:22:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 698E7385741C From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101925] [10/11/12 Regression] reversed storage order when compiling with -O3 only since r10-4742-g9b75f56d4b7951c6 Date: Mon, 16 Aug 2021 08:22:34 +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: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: priority cc bug_status target_milestone assigned_to 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: Mon, 16 Aug 2021 08:22:34 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101925 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P2 CC| |ebotcazou at gcc dot gnu.o= rg Status|NEW |ASSIGNED Target Milestone|--- |10.4 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org --- Comment #3 from Richard Biener --- Hmm, I suppose when the vectorizer detects grouped loads/stores in vect_analyze_data_ref_accesses we have to give up. OTOH even w/o grouped loads the vectorizer will rewrite a.b.c[i] to MEM_REFs based on 'a' and thus not properly retain the reverse storage attributes. Which means a fix in vect_analyze_data_refs would be better? OTOH other loop optimizations also rely on refs that pass through data-ref analysis to be reconstructible from the analyzed base + offset so even better fail in data-ref analysis already? I suppose that for regular loop opts it might work to just set REF_REVERSE_STORAGE_ORDER on a MEM_REF created from base + offset when the original DR_REF had that set? But when vectorizing we're using a vector type for the access and clearly the storage order bits apply to the component (which we _usually_ do not change). Eric, any suggestions? Given the above I'd just fix vect_analyze_data_refs and leave other loop opts "latent" (I can't actually think of a broken one)= ?=