[llvm-bugs] [Bug 52215] New: Missing register aliases for AVR for compatibility with gcc-avr's inline assembly
llvm-bugs at lists.llvm.org
Tue Oct 19 06:15:18 PDT 2021
Bug ID: 52215
Summary: Missing register aliases for AVR for compatibility
with gcc-avr's inline assembly
Component: Backend: AVR
Assignee: unassignedbugs at nondot.org
Reporter: marian.buschsieweke at ovgu.de
CC: llvm-bugs at lists.llvm.org
E.g. the avr-libc but also other AVR code written for gcc-avr heavily uses the
also the aliases __RAMPZ__ and __EIND__ are occasionally used.
See  for their definitions.
This is the first time I looked into the LLVM source code, so I might be
talking nonsense here. I tried to fix this by amending
lib/Target/AVR/AVRRegisterInfo.td like this:
-def R0 : AVRReg<0, "r0">, DwarfRegNum<>;
-def R1 : AVRReg<1, "r1">, DwarfRegNum<>;
+def R0 : AVRReg<0, "r0", , ["__tmp_reg__"]>, DwarfRegNum<>;
+def R1 : AVRReg<1, "r1", , ["__zero_reg__"]>, DwarfRegNum<>;
etc. - but to no avail.
I also tried to just emit assignments for the alias via `void
AVRAsmPrinter::emitStartOfAsmFile(Module &M)`, but this didn't work for me
I think that adding the aliases should be relatively trivial for someone with
same basic understanding of the LLVM code - which I sadly lack.
Also note that according to  the AVRtiny family has a different mapping
(e.g. __tmp_reg__ usually is r0, but on AVRtiny it is r16).
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs