This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: PATCH: Do not align labels for jump tables


Maxim Kuvyrkov wrote:
Mark Mitchell wrote:
Andreas Schwab wrote:

The only change since that point was to add a condition to the
testcase to make it pass on 68K/fido; those CPUs do not support
-falign-labels=8.

In which way do they not support it?

I've amended the testcase because of the following in m68k.c: override_options():


#ifndef ASM_OUTPUT_ALIGN_WITH_NOP
  if (align_labels > 2)
    {
      warning (0, "-falign-labels=%d is not supported", align_labels);
      align_labels = 0;
    }
  if (align_loops > 2)
    {
      warning (0, "-falign-loops=%d is not supported", align_loops);
      align_loops = 0;
    }
#endif

ASM_OUTPUT_ALIGN_WITH_NOP is defined in linux.h, so bare-metal m68k and fido issue a warning.

...


The definition of ASM_OUTPUT_ALIGN_WITH_NOP seems OK to me to be moved to m68k.h hence fixing the underlying problem.

Andreas,


I've tested the following patch on m68k-elf (gcc, g++ and libstdc++ testsuites) with no regressions. OK to apply?

Thanks,

--
Maxim
2009-06-03  Maxim Kuvyrkov  <maxim@codesourcery.com>

	* config/m68k/linux.h (HAVE_GAS_BALIGN_AND_P2ALIGN): Move to ...
	* config/m68k/m68k.h: ... here.
	* testsuite/gcc.dg/falign-labels.c (dg-options): Don't restrict for
	m68k and fido.
Index: src/gcc-mainline-2/gcc/testsuite/gcc.dg/falign-labels-1.c
===================================================================
--- src/gcc-mainline-2/gcc/testsuite/gcc.dg/falign-labels-1.c	(revision 147999)
+++ src/gcc-mainline-2/gcc/testsuite/gcc.dg/falign-labels-1.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-falign-labels=8" { target { ! { m68k*-*-* || fido*-*-* } } } } */
+/* { dg-options "-falign-labels=8" } */
 
 /* On ARMv7-A CPUs, this test resulted in incorrect code generation.
    The code generated for the switch statement expected the jump table
Index: src/gcc-mainline-2/gcc/config/m68k/linux.h
===================================================================
--- src/gcc-mainline-2/gcc/config/m68k/linux.h	(revision 147999)
+++ src/gcc-mainline-2/gcc/config/m68k/linux.h	(working copy)
@@ -126,13 +126,6 @@ along with GCC; see the file COPYING3.  
   if ((LOG) > 0)						\
     fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG));
 
-#ifdef HAVE_GAS_BALIGN_AND_P2ALIGN
-/* Use "move.l %a4,%a4" to advance within code.  */
-#define ASM_OUTPUT_ALIGN_WITH_NOP(FILE,LOG)			\
-  if ((LOG) > 0)						\
-    fprintf ((FILE), "\t.balignw %u,0x284c\n", 1 << (LOG));
-#endif
-
 /* If defined, a C expression whose value is a string containing the
    assembler operation to identify the following data as uninitialized global
    data.  */
Index: src/gcc-mainline-2/gcc/config/m68k/m68k.h
===================================================================
--- src/gcc-mainline-2/gcc/config/m68k/m68k.h	(revision 147999)
+++ src/gcc-mainline-2/gcc/config/m68k/m68k.h	(working copy)
@@ -955,6 +955,13 @@ do { if (cc_prev_status.flags & CC_IN_68
   if ((LOG) >= 1)			\
     fprintf (FILE, "\t.even\n");
 
+#ifdef HAVE_GAS_BALIGN_AND_P2ALIGN
+/* Use "move.l %a4,%a4" to advance within code.  */
+#define ASM_OUTPUT_ALIGN_WITH_NOP(FILE,LOG)			\
+  if ((LOG) > 0)						\
+    fprintf ((FILE), "\t.balignw %u,0x284c\n", 1 << (LOG));
+#endif
+
 #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
   fprintf (FILE, "\t.skip %u\n", (int)(SIZE))
 

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