[Bug target/71216] [4.9/5/6/7 Regression] Incorrect PPC assembly due to inserted .machine pseudo-op

rin at NetBSD dot org gcc-bugzilla@gcc.gnu.org
Fri Dec 16 10:07:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71216

--- Comment #7 from Rin Okuyama <rin at NetBSD dot org> ---
I'm the submitter of Bug 78764. I confirmed that my problem has been
resolved on gcc-5-branch. Let me thank you again for fixing it.

However, I have a question on this fix. How about the case where
"-Wa,-mXXX" option is given without "-mcpu=YYY" option specified?
The user expects that the assembler generates instructions for XXX,
and GCC itself does not take special care of the CPU type. However,
against this expectation, ".machine ppc" pseudo-op is output in
this case, which discards the CPU type specified by "-Wa,-mXXX".

This may sound pedantic to you. However, this is dangerous because
some special mnemonics in inline assembler codes can be misassembled.
In addition, for example, "-mcpu=e500" is forbidden whereas "-Wa,-me500"
is possible; the user cannot use instructions for e500 in inline
assembler codes.


More information about the Gcc-bugs mailing list