[llvm-dev] Unsupported expression in static initializer?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 15 13:40:00 PST 2017

On 15 February 2017 at 13:22, Andrew Kelley via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> LLVM ERROR: Unsupported expression in static initializer: zext (i64 ptrtoint
> (i32* @an_integer to i64) to i72)

It's the zext to a really weird type. Generally static initializers
are only supported if they map neatly to a target's relocation (or an
expression not needing any relocation).

You could probably emulate it with something (depending on endianness) like

    @var = global [i32*, i8] [i32* @an_integer, i8 0]

cast that to an i72* before each use and you probably can't tell the difference.


More information about the llvm-dev mailing list