On Fri, 7 Sep 2018 at 16:59, Tim Northover <t.p.northover at gmail.com> wrote:> $ clang -target mips64el-img-linux -mcpu=mips3 -S -o- -Os tmp.c >Actually, I just tried your flags; you're missing `-msingle-float`, which is what reproduces the crash on my end. Without it there is no problem. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180907/a929ae60/attachment.html>
On Fri, 7 Sep 2018 at 17:33, Dan Ravensloft <dan.ravensloft at gmail.com> wrote:> Actually, I just tried your flags; you're missing `-msingle-float`, which is what reproduces the crash on my end. Without it there is no problem.Oops, yes, I was then. Fortunately not last night though, and my Clang still works with -msingle-float. I looked at your diffs and you've only changed one of the functions to return SDValue(), you need to change lowerFP_TO_SINT itself too. The one with the store is just there as an optimization; if it doesn't trigger (because of your diff) then lowerFP_TO_SINT will still create a bad node afterwards. Cheers. Tim.
On Fri, 7 Sep 2018 at 17:48, Tim Northover <t.p.northover at gmail.com> wrote:> I looked at your diffs and you've only changed one of the functions to > return SDValue(), you need to change lowerFP_TO_SINT itself too. The > one with the store is just there as an optimization; if it doesn't > trigger (because of your diff) then lowerFP_TO_SINT will still create > a bad node afterwards. >Thank you! With that, the four bugs I found in newlib's C code are dead. I think the lrint fix should be upstreamed right away; would you mind if I credited you in the patch? Unfortunately, we are not out of the woods yet. If memory serves me correctly, newlib has some assembly code in used for things like `_start` to bring up the C runtime, which GNU binutils accepts and Clang's assembler currently does not. I'll go build that so I'm not talking out of my ass. Cheers, Tim! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180907/79e75992/attachment.html>