In some cases, it would be useful if the presence of the gcc -mregnames option was not only communicated to the assembler, but also to the C program being compiled. This comes up in an unusual usage of inline-assembler operands, where the ambiguity between literals and register names is a problem. (http://sourceware.org/PR11821). With such a macro (say, -D__GCC_REGNAMES), the inline-asm code could emit extra code strings to allow resolution of the ambiguities.
>ambiguity It is not ambiguous at all in correct usage of inline-asm. I don't support a macro for this option at all.
> It is not ambiguous at all in correct usage of inline-asm. Well, considering that the "g" constraint can generate either a literal or a naked register number, the ambiguity is real even for normal inline assembly.
This seems to be now related to PR 32998 -grecord-gcc-switches although that works only with DWARF, -frecord-gcc-switches cannot differentiate between CUs.
We have worked around this powerpc oddity in systemtap's recent sdt.h versions by using both %0 and %I0 together to get a special markup for literals vs. register names.
Closing then.