This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix bootstrap on ia64 with old GCC version.


In order to make GCC 4.1 happy and build current tip, we need to define
static constants out of a class definition.

Ready for trunk?


2018-07-03  Martin Liska  <>

	* tree-switch-conversion.h (struct jump_table_cluster): Define
        constant values outside of class declaration.
 gcc/tree-switch-conversion.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-switch-conversion.h b/gcc/tree-switch-conversion.h
index 4beac785f05..8efb125aff1 100644
--- a/gcc/tree-switch-conversion.h
+++ b/gcc/tree-switch-conversion.h
@@ -259,12 +259,17 @@ struct jump_table_cluster: public group_cluster
   static bool is_enabled (void);
   /* Max growth ratio for code that is optimized for size.  */
-  static const unsigned HOST_WIDE_INT max_ratio_for_size = 3;
+  static const unsigned HOST_WIDE_INT max_ratio_for_size;
   /* Max growth ratio for code that is optimized for speed.  */
-  static const unsigned HOST_WIDE_INT max_ratio_for_speed = 8;
+  static const unsigned HOST_WIDE_INT max_ratio_for_speed;
+const unsigned HOST_WIDE_INT jump_table_cluster::max_ratio_for_size = 3;
+const unsigned HOST_WIDE_INT jump_table_cluster::max_ratio_for_speed = 8;
 /* A GIMPLE switch statement can be expanded to a short sequence of bit-wise
 comparisons.  "switch(x)" is converted into "if ((1 << (x-MINVAL)) & CST)"
 where CST and MINVAL are integer constants.  This is better than a series

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]