diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-11-20 22:01:48 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-11-20 22:01:48 +0000 |
commit | 233db724fac81bccf711c461f74adf9eaaa95a9c (patch) | |
tree | 4d44974d8442f69dfeaa736694f572d742d99fcd | |
parent | 430c6cebe1f5acbbc209c12717cfe085c759f73e (diff) | |
download | gcc-233db724fac81bccf711c461f74adf9eaaa95a9c.zip gcc-233db724fac81bccf711c461f74adf9eaaa95a9c.tar.gz gcc-233db724fac81bccf711c461f74adf9eaaa95a9c.tar.bz2 |
re PR target/31100 (ASM_OUTPUT_ALIGN_WITH_NOP wrong with GNU as)
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: r166986
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/sparc/sol2-gas.h | 3 | ||||
-rw-r--r-- | gcc/config/sparc/sol2.h | 7 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.h | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/sparc/sparc-align-1.c | 31 |
6 files changed, 52 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3fd3ae1..6e12260 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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-20 Jan Hubicka <jh@suse.cz> * cgraph.c (ld_plugin_symbol_resolution_names): New. diff --git a/gcc/config/sparc/sol2-gas.h b/gcc/config/sparc/sol2-gas.h index d61a9fe..4bc2cb4 100644 --- a/gcc/config/sparc/sol2-gas.h +++ b/gcc/config/sparc/sol2-gas.h @@ -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 diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h index 26c9ac7..1128662 100644 --- a/gcc/config/sparc/sol2.h +++ b/gcc/config/sparc/sol2.h @@ -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 diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index e064899..ccf5f73 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fb02c95..1d6a14a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-11-20 Eric Botcazou <ebotcazou@adacore.com> + + * gcc.target/sparc/sparc-align-1.c: New test. + 2010-11-20 Nathan Froyd <froydnj@codesourcery.com> PR c++/16189 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 index 0000000..14c915e --- /dev/null +++ b/gcc/testsuite/gcc.target/sparc/sparc-align-1.c @@ -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; +} |