From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14238 invoked by alias); 13 May 2013 09:15:56 -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 14213 invoked by uid 48); 13 May 2013 09:15:52 -0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/57260] Generated R_MIPS_GOT_MIPS relocation for direct function call while compiling with -O2 on MIPS N64 Date: Mon, 13 May 2013 09:15: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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_severity 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-05/txt/msg00806.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57260 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal --- Comment #4 from Andrew Pinski --- (In reply to Andrew Pinski from comment #3) > Looks like sibcalls are incorrectly done. Or maybe not since it is no longer a call but rather a sibcall which means it can never be using call16 here since it is not a real call. Smallest testcase: int shouldbecall16(void); int g(void) { return shouldbecall16(); } ---- CUT --- lui $3,%hi(%neg(%gp_rel(g))) daddu $3,$3,$25 daddiu $3,$3,%lo(%neg(%gp_rel(g))) ld $25,%got_disp(shouldbecall16)($3) .reloc 1f,R_MIPS_JALR,shouldbecall16 1: jr $25 nop Notice it is a jr rather than a jalr. I think this is correct behavior either way really. I think Xorg's sources are depending on undefined behavior dealing with undefined symbols.