[llvm-bugs] [Bug 24454] New: Malformed (e.g. "1e") FP immediate in assembly triggers an assert

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 13 17:34:45 PDT 2015


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

            Bug ID: 24454
           Summary: Malformed (e.g. "1e") FP immediate in assembly
                    triggers an assert
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: ahmed.bougacha at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Consider:

  echo "fmov v0.4s, #1e" | ./bin/llvm-mc -triple aarch64


I get:

Assertion failed: (p != end && "Exponent has no digits"), function
readExponent, file ../lib/Support/APFloat.cpp, line 123.
0  llvm-mc                  0x000000010623514e
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 46
1  llvm-mc                  0x00000001062369f9
PrintStackTraceSignalHandler(void*) + 25
2  llvm-mc                  0x0000000106236e07 SignalHandler(int) + 551
3  libsystem_platform.dylib 0x00007fff9139ceaa _sigtramp + 26
4  llvm-mc                  0x0000000106e1620d PassRegistryObj + 38653
5  llvm-mc                  0x0000000106236a1b raise + 27
6  llvm-mc                  0x0000000106236ad2 abort + 18
7  llvm-mc                  0x0000000106236ab1 __assert_rtn + 129
8  llvm-mc                  0x00000001061763af readExponent(char const*, char
const*) + 111
9  llvm-mc                  0x000000010617162f interpretDecimal(char const*,
char const*, decimalInfo*) + 639
10 llvm-mc                  0x0000000106170fe3
llvm::APFloat::convertFromDecimalString(llvm::StringRef,
llvm::APFloat::roundingMode) + 83
11 llvm-mc                  0x000000010616ba93
llvm::APFloat::convertFromString(llvm::StringRef, llvm::APFloat::roundingMode)
+ 691
12 llvm-mc                  0x000000010616b7cf
llvm::APFloat::APFloat(llvm::fltSemantics const&, llvm::StringRef) + 79
13 llvm-mc                  0x000000010616badd
llvm::APFloat::APFloat(llvm::fltSemantics const&, llvm::StringRef) + 45
14 llvm-mc                  0x0000000105f49e54 (anonymous
namespace)::AArch64AsmParser::tryParseFPImm(llvm::SmallVectorImpl<std::__1::unique_ptr<llvm::MCParsedAsmOperand,
std::__1::default_delete<llvm::MCParsedAsmOperand> > >&) + 340
15 llvm-mc                  0x0000000105f46b1a (anonymous
namespace)::AArch64AsmParser::tryCustomParseOperand(llvm::SmallVectorImpl<std::__1::unique_ptr<llvm::MCParsedAsmOperand,
std::__1::default_delete<llvm::MCParsedAsmOperand> > >&, unsigned int) + 378
16 llvm-mc                  0x0000000105f43546 (anonymous
namespace)::AArch64AsmParser::MatchOperandParserImpl(llvm::SmallVectorImpl<std::__1::unique_ptr<llvm::MCParsedAsmOperand,
std::__1::default_delete<llvm::MCParsedAsmOperand> > >&, llvm::StringRef) + 454
17 llvm-mc                  0x0000000105f3ad3d (anonymous
namespace)::AArch64AsmParser::parseOperand(llvm::SmallVectorImpl<std::__1::unique_ptr<llvm::MCParsedAsmOperand,
std::__1::default_delete<llvm::MCParsedAsmOperand> > >&, bool, bool) + 141
18 llvm-mc                  0x0000000105ee419c (anonymous
namespace)::AArch64AsmParser::ParseInstruction(llvm::ParseInstructionInfo&,
llvm::StringRef, llvm::SMLoc,
llvm::SmallVectorImpl<std::__1::unique_ptr<llvm::MCParsedAsmOperand,
std::__1::default_delete<llvm::MCParsedAsmOperand> > >&) + 9564
19 llvm-mc                  0x00000001061219ca (anonymous
namespace)::AsmParser::parseStatement((anonymous
namespace)::ParseStatementInfo&, llvm::MCAsmParserSemaCallback*) + 9082
20 llvm-mc                  0x0000000106118c3b (anonymous
namespace)::AsmParser::Run(bool, bool) + 779
21 llvm-mc                  0x0000000105d8f9d1 AssembleInput(char const*,
llvm::Target const*, llvm::SourceMgr&, llvm::MCContext&, llvm::MCStreamer&,
llvm::MCAsmInfo&, llvm::MCSubtargetInfo&, llvm::MCInstrInfo&,
llvm::MCTargetOptions&) + 961
22 llvm-mc                  0x0000000105d8d97a main + 11722


The assert is in APFloat, but tentatively filing against AArch64, since
AsmLexer::LexFloatLiteral explicitly mentions this kind of checking as being
the responsibility of the client.

-- 
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/20150814/7f4f5525/attachment.html>


More information about the llvm-bugs mailing list