From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2117 invoked by alias); 19 Nov 2014 02:00:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 1990 invoked by uid 48); 19 Nov 2014 01:59:52 -0000 From: "amker.cheng at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/58623] lack of ldp/stp optimization Date: Wed, 19 Nov 2014 02:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: amker.cheng at gmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: amker at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-11/txt/msg01787.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58623 bin.cheng changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amker.cheng at gmail dot com --- Comment #3 from bin.cheng --- Patch sent at https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02209.html On latest trunk, the patch generates below assembly for the example: .cpu generic+fp+simd .file "pr58623.c" .text .align 2 .global foo .type foo, %function foo: adrp x0, .LANCHOR0 add x2, x0, :lo12:.LANCHOR0 ldr x1, [x0, #:lo12:.LANCHOR0] ldr x0, [x2, 8] add w0, w1, w0 ret .size foo, .-foo .align 2 .global bar .type bar, %function bar: adrp x1, .LANCHOR0 add x1, x1, :lo12:.LANCHOR0 ldp w2, w0, [x1, 16] add w0, w2, w0 ret .size bar, .-bar .global d .global c .global b .global a .bss .align 3 .LANCHOR0 = . + 0 .type a, %object .size a, 8 a: .zero 8 .type b, %object .size b, 8 b: .zero 8 .type c, %object .size c, 4 c: .zero 4 .type d, %object .size d, 4 d: .zero 4 .ident "GCC: (GNU) 5.0.0 20141118 (experimental)" ldp opportunity in bar is captured, but not the one in foo. Apparently, fwprop pass propagates the expression into memory reference, corrupting the pair opportunity. This is another known issue for long time.