From owner-freebsd-amd64@FreeBSD.ORG Fri Jun 18 06:20:44 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7ABB516A4CE; Fri, 18 Jun 2004 06:20:44 +0000 (GMT) Received: from mail.mcneil.com (rrcs-west-24-199-45-54.biz.rr.com [24.199.45.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2DB5743D2D; Fri, 18 Jun 2004 06:20:42 +0000 (GMT) (envelope-from sean@mcneil.com) Received: from localhost (localhost.mcneil.com [127.0.0.1]) by mail.mcneil.com (Postfix) with ESMTP id 8070CFD04F; Thu, 17 Jun 2004 23:19:23 -0700 (PDT) Received: from mail.mcneil.com ([127.0.0.1]) by localhost (server.mcneil.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18131-01; Thu, 17 Jun 2004 23:19:22 -0700 (PDT) Received: from [24.199.45.54] (mcneil.com [24.199.45.54]) by mail.mcneil.com (Postfix) with ESMTP id 89AC8FD067; Thu, 17 Jun 2004 23:19:22 -0700 (PDT) From: Sean McNeil To: freebsd-amd64@freebsd.org In-Reply-To: <1087521851.32817.27.camel@server.mcneil.com> References: <1087346887.66377.1.camel@server.mcneil.com> <20040616015703.GA17852@dragon.nuxi.com> <1087521851.32817.27.camel@server.mcneil.com> Content-Type: text/plain Message-Id: <1087539562.18159.2.camel@server.mcneil.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Thu, 17 Jun 2004 23:19:22 -0700 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mcneil.com cc: marcus@marcuscom.com cc: freebsd-gnome@freebsd.org Subject: Re: bad compiler generated code? - firefox issues X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2004 06:20:44 -0000 On Thu, 2004-06-17 at 18:24, Sean McNeil wrote: > On Tue, 2004-06-15 at 18:57, David O'Brien wrote: > > On Tue, Jun 15, 2004 at 05:48:08PM -0700, Sean McNeil wrote: > > > I'm recompiling firefox right now and I get a whole bunch of the > > > following: > > > > > > {standard input}:766: Warning: indirect jmp without `*' > > > {standard input}:816: Warning: indirect jmp without `*' > > ... > > > this happens on quite a number of C++ source files. Looks like the > > > compiler is generating some bad assembly. > > > > This is not a useful bug report. Can you provide the preprocesed C file? > > Or at least provide command line(s) invocation that produces this? > > I took a look into this and it appears that the bad code generation of > c++ is related to my issues with firefox. Here is what I saw: > > In xpcom/base/nsExceptionService.cpp it is generating thunks as > > _ZThn8_N18nsExceptionService6AddRefEv: > addq $-8, %rdi > jmp _ZN18nsExceptionService6AddRefEv(%rip) > .size _ZThn8_N18nsExceptionService6AddRefEv, .-_ZThn8_N18nsExceptionService6AddRefEv > > when they should be > > _ZThn8_N18nsExceptionService6AddRefEv: > addq $-8, %rdi > jmp _ZN18nsExceptionService6AddRefEv > .size _ZThn8_N18nsExceptionService6AddRefEv, .-_ZThn8_N18nsExceptionService6AddRefEv > > This has been fixed in the cvs version of gcc and involves the following patch: > > *** contrib/gcc/config/i386/i386.c.orig Thu Jun 17 18:20:11 2004 > --- contrib/gcc/config/i386/i386.c Thu Jun 17 18:10:55 2004 > *************** x86_output_mi_thunk (file, thunk, delta, > *** 14607,14621 **** > output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops); > } > > ! xops[0] = DECL_RTL (function); > if (TARGET_64BIT) > { > if (!flag_pic || (*targetm.binds_local_p) (function)) > output_asm_insn ("jmp\t%P0", xops); > else > { > ! tmp = XEXP (xops[0], 0); > ! tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, tmp), UNSPEC_GOTPCREL); > tmp = gen_rtx_CONST (Pmode, tmp); > tmp = gen_rtx_MEM (QImode, tmp); > xops[0] = tmp; > --- 14607,14620 ---- > output_asm_insn ("mov{l}\t{%0, %1|%1, %0}", xops); > } > > ! xops[0] = XEXP (DECL_RTL (function), 0); > if (TARGET_64BIT) > { > if (!flag_pic || (*targetm.binds_local_p) (function)) > output_asm_insn ("jmp\t%P0", xops); > else > { > ! tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, xops[0]), UNSPEC_GOTPCREL); > tmp = gen_rtx_CONST (Pmode, tmp); > tmp = gen_rtx_MEM (QImode, tmp); > xops[0] = tmp; > > > I am rebuilding firefox with this patch and will report back if firefox works. I had to do a complete rebuild: portupgrade -fR firefox-0.9_1 Now firefox works!!! There must have been other libraries that firefox depended on that were built with the bad compiler. Sean