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]

not too big an alignment


Alignments are stored in a byte, large alignments don't actually work nicely.  This caps the alignment to 128, as most ports would define BIGGEST_ALIGNMENT to be smaller than this.  The competing change would to be to make it a short, but, I'd be happy to punt that until such time as someone actually needs that.

Ports break down this way currently:

  12 #define BIGGEST_ALIGNMENT 64
  10 #define BIGGEST_ALIGNMENT 32
   6 #define BIGGEST_ALIGNMENT 128
   3 #define BIGGEST_ALIGNMENT 8
   8 #define BIGGEST_ALIGNMENT 16

Ok?

diff --git a/gcc/genmodes.c b/gcc/genmodes.c
index b4dc0d2..8f4980c 100644
--- a/gcc/genmodes.c
+++ b/gcc/genmodes.c
@@ -1178,7 +1178,7 @@ emit_mode_base_align (void)
                          alignment);
 
   for_all_modes (c, m)
-    tagged_printf ("%u", m->alignment, m->name);
+    tagged_printf ("%u", m->alignment > 128 ? 128 : m->alignment, m->name);
 
   print_closer ();
 }


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