[Bug c/36049] New: m68k outputs bad assembly comment
The m68k build outputs bad assembly code around an inline assembly block. Compiling the attached file with gcc 4.3.0 and binutils 2.18 for --target=m68k-unknown-uclinux-uclibc on --host=i486-linux-gnu, I get: Error: junk at end of line, first unrecognized character is `|' I won't attach the assembly generated by gcc...but I'll tell you that it contains what looks like an attempted comment before and after the inline assembly block. The apparent comment is prefixed by "|" instead of the usual "#". The ASM_COMMENT_START is #define'd as "|" for most of the m68k builds. I think that this is wrong, at least for "linux" builds. ASM_COMMENT_START has been "|" for a long time, but it seems that only recent gcc versions put comments around __asm__() blocks. A simple fix that worked for me was to change ASM_COMMENT_START to "#" in gcc/config/m68k/linux.h. This might also be appropriate for other m68k platforms. I couldn't find any other bugs reporting this problem. This bug seems a little too serious and a little too easy to fix, so maybe I'm missing something. My apologies if that's the case. -- Summary: m68k outputs bad assembly comment Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kendallc at vxitech dot com GCC build triplet: i486-linux-gnu GCC host triplet: i486-linux-gnu GCC target triplet: m68k-unknown-uclinux-uclibc http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36049
[Bug c/36049] m68k outputs bad assembly comment
--- Comment #1 from kendallc at vxitech dot com 2008-04-25 21:56 --- Created an attachment (id=15532) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15532&action=view) test code that exhibits the problem -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36049
[Bug target/36049] m68k assembly comment causes assembler error
--- Comment #2 from kendallc at vxitech dot com 2008-04-26 01:40 --- Marking my own bug as invalid because it looks like gas should accept "|" as a comment. I guess this is a binutils problem. -- kendallc at vxitech dot com changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||INVALID Summary|m68k outputs bad assembly |m68k assembly comment causes |comment |assembler error http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36049
[Bug target/36049] m68k assembly comment causes assembler error
--- Comment #3 from kendallc at vxitech dot com 2008-04-27 07:32 --- The issue was the uClibc makefiles having "-Wa,--bitwise-or" as a default config option. This causes binutils to not treat "|" as a comment. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36049
[Bug c/36070] New: m68k/coldfire gcc build breaks due to sc_fpstate, sc_fpregs reference
In gcc/config/m68k/linux-unwind.h, the function m68k_fallback_frame_state() has the following: if (*(int *) sc->sc_fpstate) { int *fpregs = (int *) sc->sc_fpregs; fs->regs.reg[16].how = REG_SAVED_OFFSET; fs->regs.reg[16].loc.offset = (long) &fpregs[0] - cfa; fs->regs.reg[17].how = REG_SAVED_OFFSET; fs->regs.reg[17].loc.offset = (long) &fpregs[M68K_FP_SIZE/4] - cfa; } The variable "sc" is of type "struct sigcontext", which is defined the linux kernel headers in asm/sigcontext.h. For asm-m68k, the sigcontext structure has members sc_fpregs, sc_fpcntl, and sc_fpstate. For asm-m68knommu, the sigcontext structure does not have the sc_fp... members. This causes the gcc build to break in libgcc when the asm-m68knommu kernel headers are used. This is so with the uClinux 2.4 kernel and the vanilla linux 2.6 kernel. I'm not too familiar with the code in linux-unwind.h, but one solution might be to wrap the above code in an "#ifdef __mcffpu__". -- Summary: m68k/coldfire gcc build breaks due to sc_fpstate, sc_fpregs reference Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kendallc at vxitech dot com GCC target triplet: m68k-unknown-uclinux-uclibc http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36070