The macro ASM_OUTPUT_ALIGN_WITH_NOP on sparc contains an explicit filler on the align statement. This is given as a word representing the NOP. The GNU assembler only uses the last byte of the filler. This generates wrong code. The original SUN assembler needs this word to insert NOPs instead of zero. The testcase is compiled with gcc -v -S -O3 -falign-labels=16 test.c
The testcase: int f(int i) { int res; switch ( i ) { case 5: res = i -i ; break; default: res = i* 2; } return res; } int f(int); main() { return f(2); } -- Summary: ASM_OUTPUT_ALIGN_WITH_NOP wrong on sparc/gas Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Erwin dot Unruh at fujitsu-siemens dot com GCC build triplet: sparc-sun-solaris2.8 GCC host triplet: sparc-sun-solaris2.8 GCC target triplet: sparc-sun-solaris2.8 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31100