Creating assembler comments from RTL
DJ Delorie
dj@redhat.com
Thu Mar 10 03:00:00 GMT 2005
> Is there a good way of creating an assembler comments directly from RTL?
>
> I want to be able to add debugging/explanation strings to assembler
> listing (GAS). Unfortunately I want to do this from RTL prologue and
> epilogue (and thus avoid using TARGET_ASM_FUNCTION_EPILOGUE - where
> it would be easy!)
You might get part of it through the TARGET_START_FUNCTION hook.
You can also define insns that use unspec or unspec_volatile, which
are generated as part of your prologue/epilogue, that use a C function
to emit themselves as assembler. The C function can return a properly
formatted pattern that produces the comments you want in the final asm
file.
You could also hook ASM_OUTPUT_OPCODE to turn "keyword" opcodes from
those types of insns into full comments as needed.
More information about the Gcc
mailing list