https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102266
Bug ID: 102266 Summary: RFE: x86: print operand with optional (%rip) suffix Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: hpa at zytor dot com Target Milestone: --- Target: x86 In the Linux kernel we reasonably frequently use extended asm operand modifiers like %P[]/%p[] for encoding a memory operand that *must not* use register-indirect forms. On x86-64, they can sometimes be encoded as %rip-relative, however, there is currently no convenient way for doing so without also making the assembly code x86-64 specific whereas it otherwise would be perfectly fine dual mode. I would therefore like to request one of the following, in order of preference: 1. A modifier to emit a memory immediate operand (i.e. a constant sans $) with a (%rip) suffix assuming it can be so encoded. 2. A simple macro (like %=) that emits (%rip) on x86-64 but nothing on i386. The priority of this is quite low, but it is probably simple to implement.