[llvm-bugs] [Bug 39573] New: Write new AVRFunctionAddressSpaceVerifier pass

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 6 18:35:05 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=39573

            Bug ID: 39573
           Summary: Write new AVRFunctionAddressSpaceVerifier pass
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: AVR
          Assignee: unassignedbugs at nondot.org
          Reporter: me at dylanmckay.io
                CC: llvm-bugs at lists.llvm.org

LLVM has recently gained support for specifying the program memory address
space in the data layout.

This address space will be the one that new functions will be placed into by
default.

There are still a few callsites in LLVM that assume that the default function
address space is the default address space zero. When AVR programs hits these
paths, the IR generated has a mix of addrspace(0) and addrspace(1) functions.

The AVR backend always puts code into program memory; that's just how the AVR
ELF format works. Problems arise when IR passes transform functions without
preserving their original address space, or create new functions
unconditionally in addrspace(0). Usually, the IR verifier will catch it, but
not always.

We should write an AVR-specific pass that verifies that every single function
in the module, and produces a hard error if there is a single function that is
not in addrspace(1). The error message should include the name of the function.

This will make it much less likely for new or existing LLVM address space
assumption bugs to go unnoticed.

An example of one of these bugs: https://github.com/avr-rust/rust/issues/117

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181107/665c9d27/attachment.html>


More information about the llvm-bugs mailing list