ppc64le: gcc forces -many on gas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

When compiling the following lines with ppc64le-linux-gnu-gcc, version 11.2.0,
an incorrect instruction is assembled.

unsigned long val;
asm volatile ("mfpir %0" : "=r"(val));
// ppc64le-linux-gnu-gcc -mcpu=power9 a.c

The output binary contains
mfspr r9, 286

instead of

mfspr r9, 1023

----
It turns out that the assembler doesn't actually recognize the mfpir
opcode, but,
since gcc forces -many on the assembler, it is coaxed into assembling an
instruction that isn't the correct one for the power9 arch. The resulting binary
misbehaves. Another instance of this problem at [1].

Is there a way gcc can be told to not force -many on the assembler,
or, otherwise
be made to correctly support mfpir?

gcc configured with:
--enable-languages=c,c++ --with-long-double-128 --disable-nls --disable-multilib

Thank you,
Amol

[1] https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id=960e30029863db95ec79a71009272d
[2] https://www.nxp.com/docs/en/reference-manual/E500CORERM.pdf



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux