An unusual x86_64 code model

2011-08-09 Thread Jed Davis
The vSphere Hypervisor (ESXi) kernel runs on x86_64 and loads all text and data sections (for the kernel itself and for modules) within a 2GB window that lives around virtual address 0x4180 (65.5 TiB). Thus, 32-bit absolute addresses won't work, but %rip-relative addressing is fine. Addit

Re: An unusual x86_64 code model

2011-08-12 Thread Jed Davis
On Tue, Aug 09, 2011 at 04:58:01PM -0700, Andrew Pinski wrote: > On Tue, Aug 9, 2011 at 4:26 PM, Jed Davis wrote: > > The existing workaround, which predates my personal involvement, is to > > use -fPIE together with a -include'd file that uses a #pragma to set the > >

Re: An unusual x86_64 code model

2011-08-12 Thread Jed Davis
On Tue, Aug 09, 2011 at 04:26:06PM -0700, Jed Davis wrote: > Thus, I'm trying to find the right solution. My current attempt is to > add an -mno-plt flag in i386.opt, and add it to the list of reasons not > to print "@PLT" after symbol names. This seems to work, although

Re: An unusual x86_64 code model

2011-08-17 Thread Jed Davis
Second attempt: I now have a modified GCC 4.4.3 which recognizes -mcmodel=smallhigh; in CM_SMALLHIGH, pic_32bit_operand acts as it does for PIC (to get lea instead of movabs), and legitimate_address_p accepts SYMBOLIC_CONSTs with no indexing (for anything with a memory constraint). Beyond that, th

Re: An unusual x86_64 code model

2011-08-23 Thread Jed Davis
On Thu, Aug 18, 2011 at 03:37:15PM +0200, Michael Matz wrote: > On Wed, 17 Aug 2011, Jed Davis wrote: > > > One thing I'm not so sure about is accepting any SYMBOLIC_CONST as a > > legitimate address. That allows, for example, a symbol address cast > > to uintp

x86_64 -mcmodel=smallhigh, cont'd

2012-01-17 Thread Jed Davis
I posted about this a few months ago, but I've been busy with higher-priority work until recently, so I've only just picked it back up, but I think I've fixed the last bug. To review: my goal is to give the x86 backend a code model where code and data reside within an arbitrary 2GiB of the address

Re: How to GTYize a struct properly?

2006-08-14 Thread Jed Davis
"Laurynas Biveinis" <[EMAIL PROTECTED]> writes: > After my best effor so far: > > struct histogram_value_t GTY(()) > { > struct > {/* <--- line 48, error below occurs here */ > tree value; /* The value to profile. */ > tree stmt;

Re: Merging identical functions in GCC

2006-09-18 Thread Jed Davis
Mike Stump <[EMAIL PROTECTED]> writes: > On Sep 15, 2006, at 2:32 PM, Ross Ridge wrote: >> Also, I don't think it's safe if you merge only functions in COMDAT >> sections. > > Sure it is, one just needs to merge them as: > > variant1: nop > variant2: nop > variant3: nop > [ ... ] > > this wa

ARM, stack unwinding, and Firefox OS

2013-04-25 Thread Jed Davis
I've been working on profiling tools for Firefox OS, and one of the central problems is getting stack traces for sample-based profiling. The old APCS frame pointer variant (where r11/fp heads a linked list of {fp, sp, lr, pc} frames) is convenient -- it's compatible with the Linux kernel profiler a

Re: ARM, stack unwinding, and Firefox OS

2013-04-25 Thread Jed Davis
On Thu, Apr 25, 2013 at 07:25:42PM -0700, Jed Davis wrote: > I've attached a patch Let's try that again --Jed diff --git a/gcc-4.4.3/gcc/config/arm/arm.c b/gcc-4.4.3/gcc/config/arm/arm.c index bef07e3..ce6acf1 100644 --- a/gcc-4.4.3/gcc/config/arm/arm.c +++ b/gcc-4.4.3/gcc/con

Re: Should -Wmaybe-uninitialized be included in -Wall?

2013-07-12 Thread Jed Davis
On Wed, Jul 10, 2013 at 06:11:11PM +0200, Andi Kleen wrote: > FWIW basically -Werror -Wall defines a compiler version specific > variant of C. May be great for individual developers, but it's always > a serious mistake in any distributed Makefile. Not always. Any project large enough (or serious