From patchwork Wed Apr 11 20:20:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 151869 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 63C4CB706E for ; Thu, 12 Apr 2012 06:20:43 +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=1334780444; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version: Content-Type:Content-Disposition:User-Agent:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=K7/YofeT6KIRf6p7rA+ZyBu6Iqc=; b=AG06vorNwqgp6VcC3dzwJf06WAuIk0gycJdFcpVP3h7ZMbeFRFCxiw4P+2v7XP DjGZJcduY89rMZq8py5HGAkSXz4EaKeT4vNBqmyi4YiOGq/6hC2rWDFAcpG5PLhD PuJ3ZT/q1GAxiNrF8hNu+42v5b0bzavlWa2AxlClZiHbk= 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:X-ExtLoop1:Received:Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=TryyDaWDlMD3LCzoYOKRcG3uVE/hGrJEGb2wrwme57npn/VubhgNp9avwZJkCr QbV2kN2PeYqppeKwDWlacCFHNyyXDjjhID51NnfYDADLlAml2xIh+VpTxpmRpnRO o1Wfz0Mjx6O9rIpJdm0uxTuMKUAcCBbMdUnRBi2HADUwM=; Received: (qmail 31443 invoked by alias); 11 Apr 2012 20:20:37 -0000 Received: (qmail 31422 invoked by uid 22791); 11 Apr 2012 20:20:35 -0000 X-SWARE-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Apr 2012 20:20:18 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 11 Apr 2012 13:20:18 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by fmsmga002.fm.intel.com with ESMTP; 11 Apr 2012 13:20:18 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 4D172C1868; Wed, 11 Apr 2012 13:20:18 -0700 (PDT) Date: Wed, 11 Apr 2012 13:20:18 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: PATCH: Simplify TRY_EMPTY_VM_SPACE for Linux hosts Message-ID: <20120411202018.GA14077@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 Hi, This patch simplifies TRY_EMPTY_VM_SPACE for Linux hosts by checking pointer size when appropriate. Tested on Linux/x86-64, Linux/ia32 and Linux/x32. OK for trunk? Thanks. H.J. --- 2012-04-11 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 b535758..93c513e 100644 --- a/gcc/config/host-linux.c +++ b/gcc/config/host-linux.c @@ -64,16 +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) && defined(__LP64__) -# define TRY_EMPTY_VM_SPACE 0x1000000000 -#elif defined(__x86_64) -# define TRY_EMPTY_VM_SPACE 0x60000000 -#elif defined(__i386) -# define TRY_EMPTY_VM_SPACE 0x60000000 #elif defined(__powerpc__) # define TRY_EMPTY_VM_SPACE 0x60000000 #elif defined(__s390x__) @@ -86,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__)