[Bug target/101393] PowerPC32 inline assembly broken by commit 2d94f7dea9c73ef3c116a0ddc722724578a860fe

sirl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 21 15:49:46 GMT 2021


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

Franz Sirl <sirl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #51164|0                           |1
        is obsolete|                            |

--- Comment #7 from Franz Sirl <sirl at gcc dot gnu.org> ---
Created attachment 51189
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51189&action=edit
More complete trial patch to overhaul ASM_CPU_SPEC

This patch should be more complete now. It does the following basic things:

 - Only pass -many to the assembler when -massembler-any is given
 - Unify the non-AIX (for now) asm_cpu spec settings into rs6000-cpus.def.
Currently this uses a "static inline" function because I developed on GCC10, on
GCC11 and later using a constexpr would be much nicer.

Now, the other stuff to reliably handle -many would need some gas support,
where I likely need some help, because I've no expertise there.

First, I suggest to introduce 2 assembler warning options:

 -wany-duplicates: Warn if the mnemonic to assemble has duplicates because of
-many, this should limit the warnings to the most difficult cases. In the patch
it's automatically enabled when -massembler-any is used.
 -wany-strict: Warn if any mnemonic to assemble is only fulfilled because of
-many.

And also some additional/changed options for .machine:

 .machine "resetsticky": Reset the sticky flags (eg. VSX, AltiVec, ANY)
 .machine "pushsticky": Push CPU+sticky settings, reset the sticky flags
 .machine "push": Change to push CPU+sticky, keep the sticky flags
 .machine "pop": Change to pop CPU+sticky

The attached patch tries to make use of such a TBD change to gas.

Alternatively, gas could be changed to have -madditive-sticky and/or '.machine
"additive-sticky"' to make any '.machine "realcpu"' reset the sticky flags and
they have to be re-added again afterwards if needed. Maybe this push/pop-less
solution would be even easier to handle in the compiler?

What do you think? I hope I addressed most of your concerns, suggestions
welcome.


More information about the Gcc-bugs mailing list