From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7427 invoked by alias); 6 Oct 2013 22:18:44 -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 7391 invoked by uid 48); 6 Oct 2013 22:18:40 -0000 From: "rearnsha at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/58621] With -fsection-anchors, a superfluous 'add' is performed Date: Sun, 06 Oct 2013 22:18: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: normal X-Bugzilla-Who: rearnsha at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution 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: 2013-10/txt/msg00360.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58621 Richard Earnshaw changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #3 from Richard Earnshaw --- No, the LO12 relocations (see the AArch64 ELF bindings in infocenter) are defined to insert (S + A) & 0xff (n = 0xf, 0xe, 0xc, 0x8 for byte, halfword, word and dword respectively), so never insert more than 12 bits into the offset field, even when there is space for more. Note that the addend is inside the mask operation This is needed because the ADRP and LDR have to work as a pair when a symbol has an offset and the offset could be of arbitrary size. For example, adrp x0, A+102400 ldr w1, [x0, #:lo12:A+102400] still needs to work.