Open
Description
Clang-18 with -fsanitize=memory -fsanitize-memory-track-origins crashes on the test case.
Compiler explorer(assertion trunck): https://godbolt.org/z/d5dE46o1a
$cat mutant.c
#define d(b, c) b || b
#define aa(b, c) b || b
#define e(g, h, i, j, k, l) m(, g, 0, ) m(, g, h, ) m(, g, h, ) m(, g, 0, )
#define n(o, g, p, q, r) \
if (d(__builtin_##g(p, q), )) \
if (__builtin_##g(p, q) || aa(__builtin_##g(p, q), ))
#define s(g, p, q, i, j, k, l, t, u, v, w, x, y, z, a, b, c, d, e) \
n(, g, 0, 0, ) n(, g, 0, q, ) n(, g, 0, 0, ) n(, g, 0, q, ) n(, g, p, q, ) \
n(, g, p, 0, ) n(, g, p, q, ) n(, g, p, 0, ) n(, g, p, q, )
#define ab(b, c) b || b
#define m(o, g, h, r) \
if (ab(__builtin_##g(h), ) || d(__builtin_##g(h), )) \
if (d(__builtin_##g(h), ) || aa(__builtin_##g(h), )) \
if (d(__builtin_##g(h), ) || aa(__builtin_##g(h), ))
#define ac(o, g, p, q, r) \
if (ab(__builtin_##g(p, q), ) || d(__builtin_##g##f(p, q), )) \
d(__builtin_##g(p, q), ) || q
#define ad(g, p, q, i, j, k, l, t, u, v, w, x, y, z, a, b, c, d, e) \
ac(, g, 0, 0, ); \
ac(, g, 0, q, ); \
ac(, g, 0, 0, ); \
ac(, g, 0, q, ); \
ac(, g, p, q, ); \
ac(, g, p, q, )
void ae() {
m(, cacos, 1, ) m(, cacos, 1, ) e(cacos, 2.34567F, , , , )
e(casin, 2.34567F, , , , ) e(catan, 2.34567F, , , , ) m(, cacosh, 1, ) m(
, cacosh, 1, ) e(cacosh, 2.34567F, , , , ) e(casinh, 2.34567F, , , , )
e(catanh, 2.34567F, , , , ) e(csin, 2.34567F, , , , )
e(ccos, 2.34567F, , , , ) e(ctan, 2.34567F, , , , )
e(csinh, 2.34567F, , , , ) e(ccosh, 2.34567F, , , , )
e(ctanh, 2.34567F, , , , ) m(, clog, 1, ) e(
clog, 2.34567F, , , , ) e(csqrt, 2.34567F, , , , )
s(cpow, 1, 0, , , , , , , , , , , , , , ,
, ) s(cpow, 1.F, 0, , , , , , , , , , , , , , , , )
ad(cpow, 2, 3, , , , , , , , , , , , , , , , );
ad(cpow, 3, 4, , , , , , , , , , , , , , , , );
ad(cpow, 3, 5, , , , , , , , , , , , , , , , );
ad(cpow, 4, 2, , , , , , , , , , , , , , , , );
ad(cpow, 1.5, 3, , , , , , , , , , , , , , , , );
ac(, cpow, 2.34567F, 4.56789F, );
ac(, cpow, 2.34567F, 4.56789F, );
ac(, cpow, 2.34567F, 1.23456F, );
ac(, cpow, 2.34567F, 1.23456F, );
}
$clang-18 -fsanitize=memory -fsanitize-memory-track-origins -w mutant.c
fatal error: error in backend: Cannot select: 0x55ba955f1090: i64,ch = load<(load (s64) from %ir.57880, align 4), zext from v2i32> 0x55ba955f0bc0, 0x55ba955ee670, undef:i64
0x55ba955ee670: i64 = xor FrameIndex:i64<1379>, Constant:i64<87960930222080>
0x55ba955f0680: i64 = FrameIndex<1379>
0x55ba955ee6e0: i64 = Constant<87960930222080>
0x55ba955f0990: i64 = undef
In function: ae
clang-18: error: clang frontend command failed with exit code 70 (use -v to see invocation)
Ubuntu clang version 18.0.0 (++20231018091808+48a53509e851-1~exp1~20231018091910.1571)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-18: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-18: note: diagnostic msg: /tmp/mutant-532c87.c
clang-18: note: diagnostic msg: /tmp/mutant-532c87.sh
clang-18: note: diagnostic msg:
********************