From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23888 invoked by alias); 20 Sep 2009 22:02:09 -0000 Received: (qmail 18685 invoked by uid 48); 20 Sep 2009 22:01:55 -0000 Date: Sun, 20 Sep 2009 22:02:00 -0000 Message-ID: <20090920220155.18684.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug inline-asm/41422] incorrect code generated with asm function pointers when compiled with -fPIC on x84_64 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" 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 X-SW-Source: 2009-09/txt/msg01955.txt.bz2 ------- Comment #1 from pinskia at gcc dot gnu dot org 2009-09-20 22:01 ------- GCC outputs: movq my_asm_func@GOTPCREL(%rip), %rsi Which looks correct but since my_asm_func is local to the object file only, the assembler/linker decides something different. If you do: static void my_asm_func(void); instead it works the way you want it to work. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41422