From patchwork Fri Dec 15 09:38:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 849068 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-469308-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="E5hRH2L9"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yyljM5py4z9t1t for ; Fri, 15 Dec 2017 20:38:14 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=XBdB9UbOVcqBWJB+ t1xb3fXYEFdcCc5DnS3j7HmvOwegdtlz0UmtKIm5T2DttPJuOALJ9YEdBxAx182+ ul414JQADlV+md+JUw/WMYxyD0gdhNZL6PoVuxtPJwL0CO50P85in7nrfM7+PtXv 8yLDRr7xLFVp4i3Sqivtqk87MM4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=gSvPVoy6YIH/vhAyJCK3R0 4tJuQ=; b=E5hRH2L9NXhWgh+ynu6AZZcQ+/5T97qdckmm4+9RUxKGJduvIPIN0q bzzqmF6Q7SY1ic4OZ66U/X8hn7D8EDcPz+31Cb/sl1AcKoxNfRN5S8t4vpGFc3f7 w/aKJ3StYJSNg+L6O4gGNnR3f5ORRQY3CKfn5NiE01BK22eqKQFKk= Received: (qmail 95844 invoked by alias); 15 Dec 2017 09:38:06 -0000 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 Received: (qmail 95626 invoked by uid 89); 15 Dec 2017 09:38:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-14.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Dec 2017 09:38:03 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 186098223C for ; Fri, 15 Dec 2017 10:38:01 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YUkfNJFPw2dS for ; Fri, 15 Dec 2017 10:38:01 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id E6EC78138E for ; Fri, 15 Dec 2017 10:38:00 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] More robust fix for PR target/66488 Date: Fri, 15 Dec 2017 10:38 +0100 Message-ID: <5525269.MjqfCIikzZ@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-53-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Hi, this PR was about the blow-up of the garbage collector on x86_64-w64-mingw32 when more than 3 GB are allocated. The fix was to set HOST_BITS_PER_PTR to the appropriate value (64) in config/i386/xm-mingw32.h. This means that the same issue can happen on other P64 hosts so the attached patch replaces the fix by a more robust variant. And I'm proposing that it be installed on all active branches (the original fix is not on the 6 branch). Tested on x86_64-w64-mingw32 (6 branch) and x86_64-suse-linux (mainline), OK? 2017-12-15 Eric Botcazou PR target/66488 * ggc-page.c (HOST_BITS_PER_PTR): Do not define here... * hwint.h (HOST_BITS_PER_PTR): ...but here instead. * config/i386/xm-mingw32.h (HOST_BITS_PER_PTR): Delete. Index: config/i386/xm-mingw32.h =================================================================== --- config/i386/xm-mingw32.h (revision 255622) +++ config/i386/xm-mingw32.h (working copy) @@ -37,8 +37,3 @@ along with GCC; see the file COPYING3. "long long" values. Instead, we use "I64". */ #define HOST_LONG_LONG_FORMAT "I64" #endif - -/* this is to prevent gcc-heap.c from assuming sizeof(long) == sizeof(intptr_t) */ -#ifdef __x86_64__ -# define HOST_BITS_PER_PTR 64 -#endif Index: ggc-page.c =================================================================== --- ggc-page.c (revision 255622) +++ ggc-page.c (working copy) @@ -92,11 +92,6 @@ along with GCC; see the file COPYING3. 4: Object marks as well. */ #define GGC_DEBUG_LEVEL (0) -#ifndef HOST_BITS_PER_PTR -#define HOST_BITS_PER_PTR HOST_BITS_PER_LONG -#endif - - /* A two-level tree is used to look up the page-entry for a given pointer. Two chunks of the pointer's bits are extracted to index the first and second levels of the tree, as follows: Index: hwint.h =================================================================== --- hwint.h (revision 255622) +++ hwint.h (working copy) @@ -14,6 +14,7 @@ #define HOST_BITS_PER_SHORT (CHAR_BIT * SIZEOF_SHORT) #define HOST_BITS_PER_INT (CHAR_BIT * SIZEOF_INT) #define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG) +#define HOST_BITS_PER_PTR (CHAR_BIT * SIZEOF_VOID_P) /* The string that should be inserted into a printf style format to indicate a "long" operand. */