Alberto Barbaro via llvm-dev
2019-Jan-09 19:27 UTC
[llvm-dev] Assertion error in APInt.cpp
Hi all, I'm experimenting with the Interpreter and all look good so far :) Unfortunately when I play with the visitBinartOperator() method I have the following assertion error: Support/APInt.cpp:233: llvm::APInt llvm::APInt::operator*(const llvm::APInt &) const: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be the same"' failed. I have recompiled llvm and printer the 2 widths. BitWidth is 1 and RHS.BitWidth is 32. I would clarify that in the visitBinaryOperator() I just call Interpreter::visitBinaryOperator(I) and I do not perform any other operation. Can you imagine any reason why this error happens? I have attached the file I used for having the error. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190109/5a40894f/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: fourth.c Type: text/x-csrc Size: 160 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190109/5a40894f/attachment.c>
On Wed, Jan 9, 2019 at 10:27 PM Alberto Barbaro via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > Hi all, > I'm experimenting with the Interpreter and all look good so far :) Unfortunately when I play with the visitBinartOperator() method I have the following assertion error: > > Support/APInt.cpp:233: llvm::APInt llvm::APInt::operator*(const llvm::APInt &) const: Assertion `BitWidth == RHS.BitWidth && "Bit widths must be the same"' failed. > > I have recompiled llvm and printer the 2 widths. BitWidth is 1 and RHS.BitWidth is 32. > > I would clarify that in the visitBinaryOperator() I just call Interpreter::visitBinaryOperator(I) and I do not perform any other operation. > > Can you imagine any reason why this error happens? I have attached the file I used for having the error.I would guess because> BitWidth is 1 and RHS.BitWidth is 32.which is what it said in the assertion message. It is up to the API user to uphold that requirement.> ThanksRoman.> _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Alberto Barbaro via llvm-dev
2019-Jan-09 20:39 UTC
[llvm-dev] Assertion error in APInt.cpp
Hi Roman, Thanks for your email. I understand the error but I cannot understand why the sizes are different considering I'm just calling visitBinaryOperator with the original instruction as parameter. Thanks On Wed, Jan 9, 2019, 19:33 Roman Lebedev <lebedev.ri at gmail.com wrote:> On Wed, Jan 9, 2019 at 10:27 PM Alberto Barbaro via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > > > Hi all, > > I'm experimenting with the Interpreter and all look good so far :) > Unfortunately when I play with the visitBinartOperator() method I have the > following assertion error: > > > > Support/APInt.cpp:233: llvm::APInt llvm::APInt::operator*(const > llvm::APInt &) const: Assertion `BitWidth == RHS.BitWidth && "Bit widths > must be the same"' failed. > > > > I have recompiled llvm and printer the 2 widths. BitWidth is 1 and > RHS.BitWidth is 32. > > > > I would clarify that in the visitBinaryOperator() I just call > Interpreter::visitBinaryOperator(I) and I do not perform any other > operation. > > > > Can you imagine any reason why this error happens? I have attached the > file I used for having the error. > > I would guess because > > BitWidth is 1 and RHS.BitWidth is 32. > which is what it said in the assertion message. > It is up to the API user to uphold that requirement. > > > Thanks > Roman. > > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190109/2382a54d/attachment.html>