Index: llvm/lib/MC/MCParser/AsmParser.cpp =================================================================== --- llvm/lib/MC/MCParser/AsmParser.cpp +++ llvm/lib/MC/MCParser/AsmParser.cpp @@ -1125,7 +1125,7 @@ // semantics in the face of reassignment. if (Sym->isVariable()) { auto V = Sym->getVariableValue(/*SetUsed*/ false); - bool DoInline = isa(V); + bool DoInline = isa(V) && !Variant; if (auto TV = dyn_cast(V)) DoInline = TV->inlineAssignedExpr(); if (DoInline) { Index: llvm/test/MC/PowerPC/pr38945.s =================================================================== --- /dev/null +++ llvm/test/MC/PowerPC/pr38945.s @@ -0,0 +1,13 @@ +// RUN: llvm-mc -triple=powerpc64-pc-linux %s -o - | FileCheck %s + +NUMBER = 0x6ffffff9 + + .text +.globl main +main: + cmpwi 8,(NUMBER)@l + cmpwi 8,NUMBER@l + +// CHECK: main: +// CHECK: cmpwi 8, -7 +// CHECK: cmpwi 8, -7