https://bugs.llvm.org/show_bug.cgi?id=46919
Bug ID: 46919
Summary: Integrated assembler errors on #(label-.-8): error:
constant expression expected
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: ARM
Assignee: unassignedb...@nondot.org
Reporter: i...@maskray.me
CC: llvm-bugs@lists.llvm.org, smithp...@googlemail.com,
ties.st...@arm.com
cat > a.s <<e
str r1, [pc, #(rewrite_3 - . - 8)]
cmp r0, #0
nop
rewrite_3:
e
% llvm-mc -filetype=obj -triple armv8 a.s
a.s:1:15: error: constant expression expected
str r1, [pc, #(rewrite_3 - . - 8)]
^
This may be tricky to fix because when #(rewrite_1 - . - 8) is parsed, we don't
know rewrite_1 is defined and thus we cannot fold `rewrite_1 - .`
The `MCConstExpr *` operand is immediately stored to to the
ARMOperand::MemoryOp::OffsetImm field. The field is referenced ~80 times and
many use sites assume that it is a MCConstantExpr. We may have to defer the
creation of the field to address the issue.
Call stack:
llvm/lib/MC/MCParser/AsmParser.cpp AsmParser::Run
llvm/lib/MC/MCParser/AsmParser.cpp AsmParser::parseStatement
llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h
MCTargetAsmParser::ParseInstruction
llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp ARMAsmParser::ParseInstruction
llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp ARMAsmParser::parseOperand
llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp ARMAsmParser::parseMemory
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs