From patchwork Thu Apr 5 15:57:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 150975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id C4A70B705C for ; Fri, 6 Apr 2012 01:58:11 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1334246292; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=OSwwZC5e63zlEdwL0vUylQ2E2tE=; b=wXI92rK6YafwhUYDKThAavWj3nnfveR3jgcy1vL9IZx8HZW3mhHAe/EcMWaDeT MUCxKzPpPysodEXwph9My6O7M5wrK2cNWvvECXZOOAASFqAN0YiUHKU+lRIXbhDi phf4aGlz5vakKQmeAS61E6XPjVWJR61m4MKhIZNHoCre8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=KM3YEG32AuM/YyNXyT0h7cWLKfUHRyCbLbrwgggfEfEyoqHJTwT8mW6roIvNtH l/2TEwfml+/j2MC8aZKHkdgRMKtwMhQioOO7ICZ57JAWZXcFZ+fznPPMe/n84HYD szBIyOVGmtQmIUUDriuYq1OAZ3ZIOcXKOZWq23Ei38x8k=; Received: (qmail 16339 invoked by alias); 5 Apr 2012 15:58:09 -0000 Received: (qmail 16331 invoked by uid 22791); 5 Apr 2012 15:58:07 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-qa0-f43.google.com (HELO mail-qa0-f43.google.com) (209.85.216.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Apr 2012 15:57:53 +0000 Received: by qadb15 with SMTP id b15so1458089qad.9 for ; Thu, 05 Apr 2012 08:57:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.35.130 with SMTP id p2mr4824416qad.32.1333641472576; Thu, 05 Apr 2012 08:57:52 -0700 (PDT) Received: by 10.229.163.7 with HTTP; Thu, 5 Apr 2012 08:57:52 -0700 (PDT) In-Reply-To: References: Date: Thu, 5 Apr 2012 08:57:52 -0700 Message-ID: Subject: Re: PATCH: Define TRY_EMPTY_VM_SPACE for Linux/x32 From: "H.J. Lu" To: Uros Bizjak , Jakub Jelinek Cc: Andrew Pinski , gcc-patches@gcc.gnu.org X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Thu, Apr 5, 2012 at 8:36 AM, Uros Bizjak wrote: > On Thu, Apr 5, 2012 at 3:28 PM, H.J. Lu wrote: > >>>>> Looking at how other targets implement this check, I don't think that >>>>> this is a problem at all. This issue only shows on a non-bootstrapped >>>>> build. A full bootstrap will use correct address. >>>> >>>> The other place where it shows up is cross compilers but who is going >>>> to use a 3.2 compiler with GCC 4.8 anyways? >>>> >>> >>> FWIW, I have no problem with checking __LP64__ only. I just want to >>> mention this potential issue. >>> >> >> Here is a different patch.  It checks sizeof (void *) for those hosts >> where it is appropriate.  Does it look OK? > > Looks OK to me, but you need a GWP reviewer to OK this change now... > Here is the patch with ChangeLog. Tested on Linux/x32. Jakub, is this OK for trunk? Thanks. 2012-04-03 H.J. Lu * config/host-linux.c (TRY_EMPTY_VM_SPACE): Check pointer size for alpha, arm, i386 and x86-64. diff --git a/gcc/config/host-linux.c b/gcc/config/host-linux.c index 94b7a0b..93c513e 100644 --- a/gcc/config/host-linux.c +++ b/gcc/config/host-linux.c @@ -64,14 +64,12 @@ /* For various ports, try to guess a fixed spot in the vm space that's probably free. */ -#if defined(__alpha) -# define TRY_EMPTY_VM_SPACE 0x10000000000 +#if defined(__alpha) || defined(__ARM_EABI__) || defined(__i386) \ + || defined(__x86_64) +# define TRY_EMPTY_VM_SPACE \ + (sizeof (void *) == 8 ? 0x1000000000 : 0x60000000) #elif defined(__ia64) # define TRY_EMPTY_VM_SPACE 0x2000000100000000 -#elif defined(__x86_64) -# define TRY_EMPTY_VM_SPACE 0x1000000000 -#elif defined(__i386) -# define TRY_EMPTY_VM_SPACE 0x60000000 #elif defined(__powerpc__) # define TRY_EMPTY_VM_SPACE 0x60000000 #elif defined(__s390x__) @@ -84,8 +82,6 @@ # define TRY_EMPTY_VM_SPACE 0x60000000 #elif defined(__mc68000__) # define TRY_EMPTY_VM_SPACE 0x40000000 -#elif defined(__ARM_EABI__) -# define TRY_EMPTY_VM_SPACE 0x60000000 #elif defined(__mips__) && defined(__LP64__) # define TRY_EMPTY_VM_SPACE 0x8000000000 #elif defined(__mips__)