Bug 44995 - define a macro for presence of -mregnames option
Summary: define a macro for presence of -mregnames option
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-19 21:45 UTC by Frank Ch. Eigler
Modified: 2015-11-22 11:09 UTC (History)
3 users (show)

See Also:
Host:
Target: powerpc*-*-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ch. Eigler 2010-07-19 21:45:10 UTC
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.
Comment 1 Andrew Pinski 2010-07-19 21:48:24 UTC
>ambiguity
It is not ambiguous at all in correct usage of inline-asm.  I don't support a macro for this option at all.
Comment 2 Frank Ch. Eigler 2010-07-19 21:51:32 UTC
> 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.
Comment 3 Jan Kratochvil 2011-08-19 08:05:07 UTC
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.
Comment 4 Frank Ch. Eigler 2011-08-19 11:24:19 UTC
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.
Comment 5 Segher Boessenkool 2015-11-22 11:09:57 UTC
Closing then.