Fix float conversion in arm64 backend

This commit is contained in:
Christian Jullien 2019-11-08 07:55:05 +01:00
parent f420259ee5
commit 25781e4552
2 changed files with 14 additions and 1 deletions

View File

@ -1775,7 +1775,7 @@ ST_FUNC void gen_cvt_ftoi(int t)
ST_FUNC void gen_cvt_ftof(int t)
{
int f = vtop[0].type.t;
int f = vtop[0].type.t & VT_BTYPE;
assert(t == VT_FLOAT || t == VT_DOUBLE || t == VT_LDOUBLE);
assert(f == VT_FLOAT || f == VT_DOUBLE || f == VT_LDOUBLE);
if (t == f)

View File

@ -1,6 +1,19 @@
#include <stdio.h>
#include <math.h>
float fd;
int
test()
{
// was an internal tcc compiler error with arm64 backend until 2019-11-08
if (fd < 5.5) {
return 1;
} else {
return 0;
}
}
int main()
{
// variables