From patchwork Tue Jul 13 19:49:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 58814 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 E1F35B6F01 for ; Wed, 14 Jul 2010 05:56:09 +1000 (EST) Received: (qmail 29584 invoked by alias); 13 Jul 2010 19:56:08 -0000 Received: (qmail 29576 invoked by uid 22791); 13 Jul 2010 19:56:07 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-ww0-f41.google.com (HELO mail-ww0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Jul 2010 19:56:02 +0000 Received: by wwd20 with SMTP id 20so402033wwd.2 for ; Tue, 13 Jul 2010 12:55:59 -0700 (PDT) Received: by 10.227.132.139 with SMTP id b11mr14707864wbt.158.1279050587979; Tue, 13 Jul 2010 12:49:47 -0700 (PDT) Received: from localhost (rsandifo.gotadsl.co.uk [82.133.89.107]) by mx.google.com with ESMTPS id a27sm41787453wbe.12.2010.07.13.12.49.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 13 Jul 2010 12:49:47 -0700 (PDT) From: Richard Sandiford To: ramana.radhakrishnan@arm.com Mail-Followup-To: ramana.radhakrishnan@arm.com, gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Cc: gcc-patches@gcc.gnu.org Subject: Re: [Patch committed] Move MAX_BITS_PER_WORD into expmed.h References: <1279014514.32159.54.camel@e102325-lin.cambridge.arm.com> Date: Tue, 13 Jul 2010 20:49:45 +0100 In-Reply-To: <1279014514.32159.54.camel@e102325-lin.cambridge.arm.com> (Ramana Radhakrishnan's message of "Tue, 13 Jul 2010 10:48:34 +0100") Message-ID: <87d3ur6u1y.fsf@firetop.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 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 Ramana Radhakrishnan writes: > This patch http://gcc.gnu.org/ml/gcc-patches/2010-07/msg00601.html broke > bootstrap on arm-linux-gnueabi because while it moved references to > MAX_BITS_PER_WORD into expmed.h , it didn't move it's definition up > there. It's a target macro, so the default should really be in defaults.h. This sort of breakage shows exactly why the defaults shouldn't be hidden away in the middle of .c files. I've installed the following as obvious after testing on x86_64-linux-gnu and arm-eabi. I dropped the comment because tm.texi says exactly what the macro is. Richard gcc/ * expmed.h (MAX_BITS_PER_WORD): Move to... * defaults.h (MAX_BITS_PER_WORD): ...here. Index: gcc/expmed.h =================================================================== --- gcc/expmed.h 2010-07-13 20:38:46.000000000 +0100 +++ gcc/expmed.h 2010-07-13 20:38:50.000000000 +0100 @@ -65,14 +65,6 @@ #define CHEAPER_MULT_COST(X,Y) ((X)->co || ((X)->cost == (Y)->cost \ && (X)->latency < (Y)->latency)) -/* For compilers that support multiple targets with different word sizes, - MAX_BITS_PER_WORD contains the biggest value of BITS_PER_WORD. An example - is the H8/300(H) compiler. */ - -#ifndef MAX_BITS_PER_WORD -#define MAX_BITS_PER_WORD BITS_PER_WORD -#endif - /* This structure records a sequence of operations. `ops' is the number of operations recorded. `cost' is their total cost. Index: gcc/defaults.h =================================================================== --- gcc/defaults.h 2010-07-13 20:38:34.000000000 +0100 +++ gcc/defaults.h 2010-07-13 20:38:39.000000000 +0100 @@ -1033,6 +1033,10 @@ #define MAX_MOVE_MAX MOVE_MAX #define MIN_UNITS_PER_WORD UNITS_PER_WORD #endif +#ifndef MAX_BITS_PER_WORD +#define MAX_BITS_PER_WORD BITS_PER_WORD +#endif + #ifndef STACK_POINTER_OFFSET #define STACK_POINTER_OFFSET 0 #endif