Patchwork [committed] Move MAX_BITS_PER_WORD into expmed.h

login
register
mail settings
Submitter Richard Sandiford
Date July 13, 2010, 7:49 p.m.
Message ID <87d3ur6u1y.fsf@firetop.home>
Download mbox | patch
Permalink /patch/58814/
State New
Headers show

Comments

Richard Sandiford - July 13, 2010, 7:49 p.m.
Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> 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.

Patch

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