https://bugs.llvm.org/show_bug.cgi?id=42641
Bug ID: 42641
Summary: Floating point asm constraint for arm target without
floating point should give error
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangb...@nondot.org
Reporter: john.br...@arm.com
CC: llvm-bugs@lists.llvm.org, neeil...@live.com,
richard-l...@metafoo.co.uk
If you have some inline asm that has a constraint that specifies a
floating-point register, e.g.
float func(float t)
{
__asm__ ( "" : "=w" (t) );
return t;
}
then compiling for an arm cpu without floating point (e.g. --target=arm
-mcpu=cortex-m3) using a build of clang with asserts enabled you get
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:65: bool
llvm::DAGTypeLegalizer::SoftenFloatResult(llvm::SDNode*, unsigned int):
Assertion `isLegalInHWReg(N->getValueType(ResNo)) && "Unsupported
SoftenFloatRes opcode!"' failed.
or with a build without asserts you end up in an endless loop in SelectionDAG.
We should be rejecting this code early and giving an error. It looks like
ARMTargetInfo::validateAsmConstraint is probably the place to do this.
--
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