* [SPARC] Fix PR target/31100
@ 2010-11-21 1:28 Eric Botcazou
0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2010-11-21 1:28 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 674 bytes --]
The filler pattern defined for the .align directive on the SPARC (0x1000000)
is valid for Sun as but not for GNU as; in fact, GNU as already knows how to
do the filling on its own.
Bootstrapped/regtested on SPARC64/Solaris 9 and SPARC/Solaris 10, applied on
the mainline and 4.5 branch.
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-20 Eric Botcazou <ebotcazou@adacore.com>
* gcc.target/sparc/sparc-align-1.c: New test.
--
Eric Botcazou
[-- Attachment #2: pr31100.diff --]
[-- Type: text/x-diff, Size: 2027 bytes --]
Index: config/sparc/sol2-gas.h
===================================================================
--- config/sparc/sol2-gas.h (revision 166973)
+++ config/sparc/sol2-gas.h (working copy)
@@ -23,6 +23,9 @@ a copy of the GCC Runtime Library Except
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: config/sparc/sparc.h
===================================================================
--- config/sparc/sparc.h (revision 166973)
+++ config/sparc/sparc.h (working copy)
@@ -2013,13 +2013,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: config/sparc/sol2.h
===================================================================
--- config/sparc/sol2.h (revision 166973)
+++ config/sparc/sol2.h (working copy)
@@ -177,6 +177,13 @@ along with GCC; see the file COPYING3.
} \
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
[-- Attachment #3: sparc-align-1.c --]
[-- Type: text/x-csrc, Size: 396 bytes --]
/* 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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-11-20 22:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-21 1:28 [SPARC] Fix PR target/31100 Eric Botcazou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).