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]

[PATCH, alpha, testsuite]: Fix gcc.dg/pr39323-[2,3].c failure


Hello!

This patch fixes gcc.dg/pr39323-?.c failures on alpha (and all targets that output their alignment in log2 format).

Alpha has its own private copy of elfos.h and it sometimes gets out of sync.

Patch was regression tested on alphaev56-pc-linux-gnu, the testsuite change was also checked on x86_64-pc-linux-gnu {,-m32}.


PR c/39323 * config/alpha/elf.h (MAX_OFILE_ALIGNMENT): Sync with elfos.h

testsuite/ChangeLog:

   PR c/39323
   * gcc.dg/pr39323-2.c: Also scan for alignment in log2 format.
   * gcc.dg/pr39323-3.c: Ditto.

Patch was committed to mainline as obvious.

Uros.
Index: testsuite/gcc.dg/pr39323-2.c
===================================================================
--- testsuite/gcc.dg/pr39323-2.c	(revision 146873)
+++ testsuite/gcc.dg/pr39323-2.c	(working copy)
@@ -3,4 +3,4 @@
 
 int bar __attribute__ ((aligned(1 << 28))) =  20;
 
-/* { dg-final { scan-assembler "\.align\[\\t \]*268435456" } } */
+/* { dg-final { scan-assembler ".align\[ \t\]+(268435456|28)\[ \t\]*\n" } } */
Index: testsuite/gcc.dg/pr39323-3.c
===================================================================
--- testsuite/gcc.dg/pr39323-3.c	(revision 146873)
+++ testsuite/gcc.dg/pr39323-3.c	(working copy)
@@ -4,4 +4,5 @@
 typedef int __attribute__ ((aligned(1 << 28))) int28;
 int28 foo = 20;
 
-/* { dg-final { scan-assembler "\.align\[\\t \]*268435456" } } */
+/* { dg-final { scan-assembler ".align\[ \t\]+(268435456|28)\[ \t\]*\n" } } */
+
Index: config/alpha/elf.h
===================================================================
--- config/alpha/elf.h	(revision 146873)
+++ config/alpha/elf.h	(working copy)
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler, for DEC Alpha w/ELF.
-   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2007, 2008
-   Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2007, 2008,
+   2009 Free Software Foundation, Inc.
    Contributed by Richard Henderson (rth@tamu.edu).
 
 This file is part of GCC.
@@ -142,18 +142,20 @@
   ASM_OUTPUT_ALIGNED_LOCAL (FILE, NAME, SIZE, ALIGN);			\
 } while (0)
 
-/* Biggest alignment supported by the object file format of this
-   machine.  Use this macro to limit the alignment which can be
-   specified using the `__attribute__ ((aligned (N)))' construct.  If
-   not defined, the default value is `BIGGEST_ALIGNMENT'. 
+/* The biggest alignment supported by ELF in bits. 32-bit ELF 
+   supports section alignment up to (0x80000000 * 8), while 
+   64-bit ELF supports (0x8000000000000000 * 8). If this macro 
+   is not defined, the default is the largest alignment supported 
+   by 32-bit ELF and representable on a 32-bit host. Use this
+   macro to limit the alignment which can be specified using
+   the `__attribute__ ((aligned (N)))' construct.
 
    This value is really 2^63.  Since gcc figures the alignment in bits,
    we could only potentially get to 2^60 on suitable hosts.  Due to other
    considerations in varasm, we must restrict this to what fits in an int.  */
 
 #undef  MAX_OFILE_ALIGNMENT
-#define MAX_OFILE_ALIGNMENT \
-  (1 << (HOST_BITS_PER_INT < 64 ? HOST_BITS_PER_INT - 2 : 62))
+#define MAX_OFILE_ALIGNMENT (((unsigned int) 1 << 28) * 8)
 
 /* This is the pseudo-op used to generate a contiguous sequence of byte
    values from a double-quoted string WITHOUT HAVING A TERMINATING NUL

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