From patchwork Wed Aug 22 23:32:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 179446 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 72B122C0084 for ; Thu, 23 Aug 2012 09:33:09 +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=1346283190; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:MIME-Version:Received:In-Reply-To:References:From:Date: Message-ID:Subject:To:Cc:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=BeBsILUQrBZQPBoDk7ctdb63pnw=; b=sF8KcbZ5HBzSjJU ERy0LnijLC6hJsTA9p+w3DCLAEDpM6H/qFv7Z1i1Kc3YGHuMTpC3O+EPYp5PB8WA uxxGLJ4YPU+7fFLnTeWUfOIdY+BiQOBAid/uBDoznpGLb1XJfiDb+5GceV8ms88S /WK7td1fLXksB2kKT2nb/j2KYLFI= 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-Google-DKIM-Signature:Received:Received:MIME-Version:Received:In-Reply-To:References:From:Date:Message-ID:Subject:To:Cc:Content-Type:X-System-Of-Record:X-Gm-Message-State:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=AoN9Mger/5ikbylUSjreFKJjh62Y1r6BJiz4GJ6CWB5HnxYpK/51poba+C/7/V 5il6lLMoYJqJzvfnUuFosIEICIW7dlqKHNWG+R+dAHZwQbTfh8I/NFSHzW27VEpj HpvcBN7fMkF9ejhSINI1sZH/kCnshzrhTAebUUqmz3nlQ=; Received: (qmail 23173 invoked by alias); 22 Aug 2012 23:33:06 -0000 Received: (qmail 23164 invoked by uid 22791); 22 Aug 2012 23:33:05 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-qa0-f54.google.com (HELO mail-qa0-f54.google.com) (209.85.216.54) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Aug 2012 23:32:50 +0000 Received: by qatn12 with SMTP id n12so136633qat.20 for ; Wed, 22 Aug 2012 16:32:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=M6+Qhc+l2YMEGEWq0iQIYV6R6HkVSyU5jfdb5M8Iw1k=; b=KFeiGtGWK0ZFlyho72SMEfSqobwoPMx460qR0qcm23TEazJJnuobiajkhLh9xzMxgm JUH6IB3mbC8tIEUEUe2WsFm9lG02YWet9B/wMj4nwJ/S43tdiux8AmCEWTrDpvFxramf Xrf9VWME4Gh5QZ93+nY31PTs90axPubkRewSbDFdcc9PcCIIj0Lr+T3JEdowR/REnNjH IGFXKmNqwFriilPcPpwsgWgWafFKiNGmEOe1uFyHoQt3WGhMLsQzPS+MFrGpvTMoB/px lTy1ytEc61D3sJELZsPDdEZuDJeoKAo4QfQ9w+0QyTXjgDCFFHn+RiUlGA++RTiMftPF pk/g== Received: by 10.224.211.137 with SMTP id go9mr18382292qab.77.1345678369761; Wed, 22 Aug 2012 16:32:49 -0700 (PDT) Received: by 10.224.211.137 with SMTP id go9mr18382284qab.77.1345678369680; Wed, 22 Aug 2012 16:32:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.28.74 with HTTP; Wed, 22 Aug 2012 16:32:28 -0700 (PDT) In-Reply-To: References: From: Roland McGrath Date: Wed, 22 Aug 2012 16:32:28 -0700 Message-ID: Subject: Re: [PATCH] Fix ARM constant-pool layout calculations under -falign-labels To: Richard Earnshaw Cc: gcc-patches@gcc.gnu.org X-System-Of-Record: true X-Gm-Message-State: ALoCoQnSP0uI/RDI3Sd7F11ibKKwOnqqfzfrZvS9ovw+7rtpbKXdqhvxbNY9TFAS29U0bShq3Bmd/yV5t8ZJUq/WYybNlsFC5DiouD5fG0bYM8TEfWUd4mgj0r7AUbpz/n5H2RLoRTidk/R+LeIjSlea9k49vUU5Inwe2ZhYFsu1/+RcpY3J+wcKA+p+9mQWpGU+kAwE9hY1 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 Richard, You never responded to this. Is there something wrong with this fix? Can you address whether it's sufficient for align_loops > align_labels and such cases that Julian Brown raised? A patch against the current trunk is below. Thanks, Roland On Wed, Aug 1, 2012 at 2:43 PM, Roland McGrath wrote: > Using e.g. -falign-labels=16 on ARM can confuse the constant-pool layout > code such that it places pool entries too far away from their referring > instructions. This change seems to fix it. > > I don't have a small test case, only a large one, which I haven't actually > tried to get to reproduce on any vanilla ARM target. But the logic of the > change seems straightforward and sound. gcc/ 2012-08-22 Roland McGrath * config/arm/arm.c (get_label_padding): Use align_labels as minimum. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 2805b7c..586d094 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -12409,6 +12409,7 @@ get_label_padding (rtx label) HOST_WIDE_INT align, min_insn_size; align = 1 << label_to_alignment (label); + align = MAX (align, align_labels); min_insn_size = TARGET_THUMB ? 2 : 4; return align > min_insn_size ? align - min_insn_size : 0; }