]> granicus.if.org Git - clang/commit
CodeGen: Cast llvm.flt.rounds result to match __builtin_flt_rounds
authorAnton Korobeynikov <anton@korobeynikov.info>
Thu, 17 Jan 2019 15:21:55 +0000 (15:21 +0000)
committerAnton Korobeynikov <anton@korobeynikov.info>
Thu, 17 Jan 2019 15:21:55 +0000 (15:21 +0000)
commit03591ee3511478e575dbf3306a3982f842f1e0fd
tree1a3bce76b4c7b605a37cf1c45ff7c179028c70c1
parentf4a17e789b68f196bdac6eb88a7126988cee65f3
CodeGen: Cast llvm.flt.rounds result to match __builtin_flt_rounds

llvm.flt.rounds returns an i32, but the builtin expects an integer.
On targets where integers are not 32-bits clang tries to bitcast the result, causing an assertion failure.

The patch enables newlib build for msp430.

Patch by Edward Jones!

Differential Revision: https://reviews.llvm.org/D24461

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351449 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGBuiltin.cpp
test/CodeGen/builtins-msp430.c [new file with mode: 0644]
test/CodeGen/builtins.c