]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/31100 (ASM_OUTPUT_ALIGN_WITH_NOP wrong with GNU as)
authorEric Botcazou <ebotcazou@adacore.com>
Sat, 20 Nov 2010 22:05:08 +0000 (22:05 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 20 Nov 2010 22:05:08 +0000 (22:05 +0000)
PR target/31100
* config/sparc/sparc.h (ASM_OUTPUT_ALIGN_WITH_NOP): Move to...
* config/sparc/sol2.h (ASM_OUTPUT_ALIGN_WITH_NOP): ...here.
* config/sparc/sol2-gas.h (ASM_OUTPUT_ALIGN_WITH_NOP): Undefine.

From-SVN: r166987

gcc/ChangeLog
gcc/config/sparc/sol2-gas.h
gcc/config/sparc/sol2.h
gcc/config/sparc/sparc.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/sparc/sparc-align-1.c [new file with mode: 0644]

index 31e3d5c460ca00db9238917437f031b5fecf938f..9cc8e60edfa07cae56977d7b5b0f82fad3747cb6 100644 (file)
@@ -1,3 +1,10 @@
+2010-11-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR target/31100
+       * config/sparc/sparc.h (ASM_OUTPUT_ALIGN_WITH_NOP): Move to...
+       * config/sparc/sol2.h (ASM_OUTPUT_ALIGN_WITH_NOP): ...here.
+       * config/sparc/sol2-gas.h (ASM_OUTPUT_ALIGN_WITH_NOP): Undefine.
+
 2010-11-19  Joseph Myers  <joseph@codesourcery.com>
 
        PR c/46547
index d61a9fe09cdfa0f9b4c1adb80d62ccdc690f5c30..4bc2cb470aeb2b53e907f9b24d0feb1f131b9d9d 100644 (file)
@@ -23,6 +23,9 @@ a copy of the GCC Runtime Library Exception along with this program;
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
+/* Undefine this as the filler pattern doesn't work with GNU as.  */
+#undef ASM_OUTPUT_ALIGN_WITH_NOP
+
 /* Undefine this so that BNSYM/ENSYM pairs are emitted by STABS+.  */
 #undef NO_DBX_BNSYM_ENSYM
 
index a341bcfd30b4e457823544da1714dde57a73abe4..4523f8c3ed6e422971e75dc866a9d1e0e2ee744a 100644 (file)
@@ -177,6 +177,13 @@ along with GCC; see the file COPYING3.  If not see
     }                                                          \
   while (0)
 
+/* This is how to output an assembler line that says to advance
+   the location counter to a multiple of 2**LOG bytes using the
+   NOP instruction as padding.  */
+#define ASM_OUTPUT_ALIGN_WITH_NOP(FILE,LOG)   \
+  if ((LOG) != 0)                             \
+    fprintf (FILE, "\t.align %d,0x1000000\n", (1<<(LOG)))
+
 /* Use Solaris ELF section syntax.  */
 #undef TARGET_ASM_NAMED_SECTION
 #define TARGET_ASM_NAMED_SECTION sparc_solaris_elf_asm_named_section
index b4b43c0512662318017cf40de27598686e82e300..6aa9775db2b7fce070a10adf196e9b2d55cc60f6 100644 (file)
@@ -2156,13 +2156,6 @@ do {                                                                     \
   if ((LOG) != 0)                      \
     fprintf (FILE, "\t.align %d\n", (1<<(LOG)))
 
-/* This is how to output an assembler line that says to advance
-   the location counter to a multiple of 2**LOG bytes using the
-   "nop" instruction as padding.  */
-#define ASM_OUTPUT_ALIGN_WITH_NOP(FILE,LOG)   \
-  if ((LOG) != 0)                             \
-    fprintf (FILE, "\t.align %d,0x1000000\n", (1<<(LOG)))
-
 #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
   fprintf (FILE, "\t.skip "HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE))
 
index ff9d6bcfc268c348c5e1fc0b07bbbbb42fad9408..6f0d22d1e0db1ef8a5a652a67aa1fc032743ea30 100644 (file)
@@ -1,3 +1,7 @@
+2010-11-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc.target/sparc/sparc-align-1.c: New test.
+
 2010-11-19  Joseph Myers  <joseph@codesourcery.com>
 
        PR c/46547
diff --git a/gcc/testsuite/gcc.target/sparc/sparc-align-1.c b/gcc/testsuite/gcc.target/sparc/sparc-align-1.c
new file mode 100644 (file)
index 0000000..14c915e
--- /dev/null
@@ -0,0 +1,31 @@
+/* PR target/31100 */
+/* Reported by Erwin Unruh <Erwin.Unruh@fujitsu-siemens.com> */
+
+/* { dg-do run } */
+/* { dg-options "-falign-labels=16" } */
+
+extern void abort(void);
+
+int f(int i)
+{
+  int res;
+
+  switch (i)
+    {
+    case 5:
+      res = i - i;
+      break;
+    default:
+      res = i * 2;
+      break;
+    }
+
+  return res;
+}
+
+int main(void)
+{
+  if (f(2) != 4)
+    abort ();
+  return 0;
+}