Hi, developers, I notice following asm symbol definitions are eveluated improperly: A = 9 B = 3*A - 2 * A + 1 the value of B should be 10 instead of 8. It seems asm parser treat "B = 3*A - 2 * A + 1" as "B = 3*A - (2 * A + 1)" because the second "*" has higher precedence than "-", and evaluation just performs simple recursion within AsmParser::ParseBinOpRHS (which resides in file lib/MC/MCParser/AsmParser.cpp). Can some one make a fixup? Regard. -- 杨勇勇 (Yang Yong-Yong) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130503/0325d37c/attachment.html>
Rafael Espíndola
2013-May-03 12:23 UTC
[LLVMdev] bug report on MC asm parser evaluating expressions
On 3 May 2013 01:37, 杨勇勇 <triple.yang at gmail.com> wrote:> Hi, developers, > > I notice following asm symbol definitions are eveluated improperly: > > A = 9 > B = 3*A - 2 * A + 1 > > the value of B should be 10 instead of 8. > > It seems asm parser treat "B = 3*A - 2 * A + 1" as "B = 3*A - (2 * A + 1)" > because the second "*" has higher precedence than "-", and evaluation just > performs simple recursion within AsmParser::ParseBinOpRHS (which resides in > file lib/MC/MCParser/AsmParser.cpp). > > Can some one make a fixup?This is a horrible bug :-( Can you please report it in llvm.org/bugs? Thanks, Rafael
Kevin Enderby
2013-May-07 21:45 UTC
[LLVMdev] bug report on MC asm parser evaluating expressions
I just fixed this with r181366. URL: http://llvm.org/viewvc/llvm-project?rev=181366&view=rev Kev On May 3, 2013, at 5:23 AM, Rafael Espíndola <rafael.espindola at gmail.com> wrote:> On 3 May 2013 01:37, 杨勇勇 <triple.yang at gmail.com> wrote: >> Hi, developers, >> >> I notice following asm symbol definitions are eveluated improperly: >> >> A = 9 >> B = 3*A - 2 * A + 1 >> >> the value of B should be 10 instead of 8. >> >> It seems asm parser treat "B = 3*A - 2 * A + 1" as "B = 3*A - (2 * A + 1)" >> because the second "*" has higher precedence than "-", and evaluation just >> performs simple recursion within AsmParser::ParseBinOpRHS (which resides in >> file lib/MC/MCParser/AsmParser.cpp). >> >> Can some one make a fixup? > > This is a horrible bug :-( > > Can you please report it in llvm.org/bugs? > > Thanks, > Rafael > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130507/893335f9/attachment.html>
Apparently Analagous Threads
- [LLVMdev] bug report on MC asm parser evaluating expressions
- [LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
- [LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
- [4.0.0 Release] Relase Candidate 1 has been tagged
- [LLVMdev] How to write a regression test case?