[m68k] Fix PR 14018: -malign-loops/-malign-jumps broken

Bernardo Innocenti bernie@develer.com
Sun May 30 14:05:00 GMT 2004


The -malign-loops, -malign-functions and -malign-jumps are both
broken and superseded by the -falign-* equivalents.  Surprisingly,
they weren't even documented in invoke.texi.

All considered, these options should be removed right away,
skipping the usual deprecation cycle.

Regression tests on m68k-linux are still in progress.
OK to commit once completed with no new regressions?


2004-05-29  Bernardo Innocenti  <bernie@develer.com>

	PR target/14018
	* config/m68k/m68k.c (m68k_align_loops_string, m68k_align_jumps_string,
	m68k_align_funcs_string, m68k_align_loops, m68k_align_jumps,
	m68k_align_funcs): Remove.
	(override_options): Remove code to handle -malign-* options.
	* config/m68k/m68k.h (TARGET_OPTIONS): Remove -malign-* options.
	(FUNCTION_BOUNDARY, LOOP_ALIGN, LOOP_ALIGN_AFTER_BARRIER): Remove.
	(m68k_align_loops_string, m68k_align_jumps_string,
	m68k_align_funcs_string, m68k_align_loops, m68k_align_jumps,
	m68k_align_funcs): Remove definitions.

Index: gcc/config/m68k/m68k.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k.c,v
retrieving revision 1.131
diff -u -p -u -p -r1.131 m68k.c
--- gcc/config/m68k/m68k.c	29 May 2004 15:22:39 -0000	1.131
+++ gcc/config/m68k/m68k.c	29 May 2004 17:08:43 -0000
@@ -123,23 +123,9 @@ static int const_int_cost (rtx);
 static bool m68k_rtx_costs (rtx, int, int, int *);
 
 
-/* Alignment to use for loops and jumps */
-/* Specify power of two alignment used for loops.  */
-const char *m68k_align_loops_string;
-/* Specify power of two alignment used for non-loop jumps.  */
-const char *m68k_align_jumps_string;
-/* Specify power of two alignment used for functions.  */
-const char *m68k_align_funcs_string;
 /* Specify the identification number of the library being built */
 const char *m68k_library_id_string;
 
-/* Specify power of two alignment used for loops.  */
-int m68k_align_loops;
-/* Specify power of two alignment used for non-loop jumps.  */
-int m68k_align_jumps;
-/* Specify power of two alignment used for functions.  */
-int m68k_align_funcs;
-
 /* Nonzero if the last compare/test insn had FP operands.  The
    sCC expanders peek at this to determine what to do for the
    68060, which has no fsCC instructions.  */
@@ -221,22 +207,6 @@ struct gcc_target targetm = TARGET_INITI
 void
 override_options (void)
 {
-  int def_align;
-  int i;
-
-  def_align = 1;
-
-  /* Validate -malign-loops= value, or provide default */
-  m68k_align_loops = def_align;
-  if (m68k_align_loops_string)
-    {
-      i = atoi (m68k_align_loops_string);
-      if (i < 1 || i > MAX_CODE_ALIGN)
-	error ("-malign-loops=%d is not between 1 and %d", i, MAX_CODE_ALIGN);
-      else
-	m68k_align_loops = i;
-    }
-
   /* Library identification */
   if (m68k_library_id_string)
     {
@@ -269,29 +239,6 @@ override_options (void)
   if (TARGET_SEP_DATA || TARGET_ID_SHARED_LIBRARY)
     flag_pic = 2;
 
-  /* Validate -malign-jumps= value, or provide default */
-  m68k_align_jumps = def_align;
-  if (m68k_align_jumps_string)
-    {
-      i = atoi (m68k_align_jumps_string);
-      if (i < 1 || i > MAX_CODE_ALIGN)
-	error ("-malign-jumps=%d is not between 1 and %d", i, MAX_CODE_ALIGN);
-      else
-	m68k_align_jumps = i;
-    }
-
-  /* Validate -malign-functions= value, or provide default */
-  m68k_align_funcs = def_align;
-  if (m68k_align_funcs_string)
-    {
-      i = atoi (m68k_align_funcs_string);
-      if (i < 1 || i > MAX_CODE_ALIGN)
-	error ("-malign-functions=%d is not between 1 and %d",
-	       i, MAX_CODE_ALIGN);
-      else
-	m68k_align_funcs = i;
-    }
-
   /* -fPIC uses 32-bit pc-relative displacements, which don't exist
      until the 68020.  */
   if (!TARGET_68020 && !TARGET_COLDFIRE && (flag_pic == 2))
Index: gcc/config/m68k/m68k.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/m68k/m68k.h,v
retrieving revision 1.112
diff -u -p -u -p -r1.112 m68k.h
--- gcc/config/m68k/m68k.h	29 May 2004 15:10:41 -0000	1.112
+++ gcc/config/m68k/m68k.h	29 May 2004 17:08:46 -0000
@@ -183,7 +183,7 @@ extern int target_flags;
 #define MASK_SHORT	(1<<12)
 #define TARGET_SHORT	(target_flags & MASK_SHORT)
 
-/* Align ints to a word boundary.  This breaks compatibility with the 
+/* Align ints to a word boundary.  This breaks compatibility with the
    published ABI's for structures containing ints, but produces faster
    code on cpus with 32-bit busses (020, 030, 040, 060, CPU32+, ColdFire).
    It's required for ColdFire cpus without a misalignment module.  */
@@ -355,12 +355,7 @@ extern int target_flags;
    option if the fixed part matches.  The actual option name is made
    by appending `-m' to the specified name.  */
 #define TARGET_OPTIONS							\
-{ { "align-loops=",	&m68k_align_loops_string,			\
-    N_("Loop code aligned to this power of 2"), 0},			\
-  { "align-jumps=",	&m68k_align_jumps_string,			\
-    N_("Jump targets are aligned to this power of 2"), 0},		\
-  { "align-functions=",	&m68k_align_funcs_string,			\
-    N_("Function starts are aligned to this power of 2"), 0},		\
+{									\
   { "shared-library-id=",	&m68k_library_id_string,		\
     N_("ID of shared library to build"), 0},				\
   SUBTARGET_OPTIONS							\
@@ -419,9 +414,9 @@ extern int target_flags;
 /* Boundary (in *bits*) on which stack pointer should be aligned.  */
 #define STACK_BOUNDARY 16
 
 /* Allocation boundary (in *bits*) for the code of a function.  */
-#define FUNCTION_BOUNDARY (1 << (m68k_align_funcs + 3))
+#define FUNCTION_BOUNDARY 16

 /* Alignment of field after `int : 0' in a structure.  */
 #define EMPTY_FIELD_BOUNDARY 16
 
@@ -442,19 +434,13 @@ extern int target_flags;
 /* Maximum number of library ids we permit */
 #define MAX_LIBRARY_ID 255
 
-/* Align loop starts for optimal branching.  */
-#define LOOP_ALIGN(LABEL) (m68k_align_loops)
-
-/* This is how to align an instruction for optimal branching.  */
-#define LABEL_ALIGN_AFTER_BARRIER(LABEL) (m68k_align_jumps)
-
 /* Define number of bits in most basic integer type.
    (If undefined, default is BITS_PER_WORD).  */
 
 #define INT_TYPE_SIZE (TARGET_SHORT ? 16 : 32)
 
 /* Define these to avoid dependence on meaning of `int'.  */
- 
+
 #define WCHAR_TYPE "long int"
 #define WCHAR_TYPE_SIZE 32
 
@@ -1699,13 +1685,7 @@ do { if (cc_prev_status.flags & CC_IN_68
 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR)
 
 /* Variables in m68k.c */
-extern const char *m68k_align_loops_string;
-extern const char *m68k_align_jumps_string;
-extern const char *m68k_align_funcs_string;
 extern const char *m68k_library_id_string;
-extern int m68k_align_loops;
-extern int m68k_align_jumps;
-extern int m68k_align_funcs;
 extern int m68k_last_compare_had_fp_operands;
 
 

-- 
  // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/



More information about the Gcc-patches mailing list