From patchwork Wed Oct 15 22:07:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 400104 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D0E221400F4 for ; Thu, 16 Oct 2014 09:08:09 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :message-id:from:to:subject; q=dns; s=default; b=yNAwQt1ATTg4cfV IZ2HceM4VrGarn8zUAeofusCY5+fKQrxP4uk2+9SfkyrpQidFjH3IFj379ia8IDZ hUs7ooKKqbpeCemKqnZJD3DLuOgnYdZ3yIfJ8QTRw5C1HpiubMiFbhNOz7ZIF6gB WJSRwbr/kfdeEU0D6CFRiX8T+ulg= 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:date :message-id:from:to:subject; s=default; bh=HBGTY08T0o282VRhyOuMz TooE2E=; b=Da3xDOIbcTC2V+7dE/hDSmbtips51DT/GktT/hMsS4PqV42GpCLYE Ukqg5LiH/gRwhmEVM/9XarbsZ8NkcaXv9llhk578xpsrCsCq9F+VwYndRJ7XF2ts XabJ/ZPbe3nSyo17zJPnPUppLWa+lKZ8xz7Mye6C+sNBHDbhhP3lKw= Received: (qmail 28123 invoked by alias); 15 Oct 2014 22:08:02 -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 28113 invoked by uid 89); 15 Oct 2014 22:08:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 15 Oct 2014 22:08:01 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9FM80d4012956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 15 Oct 2014 18:08:00 -0400 Received: from greed.delorie.com (ovpn-113-33.phx2.redhat.com [10.3.113.33]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9FM7xBC003586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 15 Oct 2014 18:07:59 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.14.4/8.14.4) with ESMTP id s9FM7wdl011990; Wed, 15 Oct 2014 18:07:58 -0400 Received: (from dj@localhost) by greed.delorie.com (8.14.4/8.14.4/Submit) id s9FM7wE8011989; Wed, 15 Oct 2014 18:07:58 -0400 Date: Wed, 15 Oct 2014 18:07:58 -0400 Message-Id: <201410152207.s9FM7wE8011989@greed.delorie.com> From: DJ Delorie To: gcc-patches@gcc.gnu.org Subject: [lto] don't assume pointer size X-IsSubscribed: yes In the event that pointer sizes aren't powers of two, choose a more suitable alignment than (unsigned)(-1), which results in HUGE file sizes. Ok? Index: gcc/lto/lto-object.c =================================================================== --- gcc/lto/lto-object.c (revision 216287) +++ gcc/lto/lto-object.c (working copy) @@ -335,13 +335,13 @@ lto_obj_begin_section (const char *name) lo = (struct lto_simple_object *) current_out_file; gcc_assert (lo != NULL && lo->sobj_r == NULL && lo->sobj_w != NULL && lo->section == NULL); - align = exact_log2 (POINTER_SIZE / BITS_PER_UNIT); + align = ceil_log2 (POINTER_SIZE_UNITS); lo->section = simple_object_write_create_section (lo->sobj_w, name, align, &errmsg, &err); if (lo->section == NULL) { if (err == 0) fatal_error ("%s", errmsg);