Discussion:
Get LLVM ERROR when compiling program using clang with option -fsanitize=undefined
(too old to reply)
Dingbao Xie
2014-10-18 01:02:40 UTC
Permalink
Hi all,
I got an LLVM error when using klee to analyze a program generated by
clang-3.4.
I tried to debug it by myself and finally found that the error is produced
when calling
PassManager.run (klee/lib/Module/KModule.cpp, function prepare, pm3.run).

The detailed error information is:
LLVM ERROR: Code generator does not support intrinsic function
'llvm.sadd.with.overflow.i32'!

Attachment is the test program that I used.

Does anyone know why LLVM produced such error and how can I get around it.
BTW I built klee with LLVM-3.4.

Thanks in advance.
--
Dingbao Xie
Cristian Cadar
2014-10-19 16:25:53 UTC
Permalink
You already reported this problem and were told that KLEE doesn't have
support for this intrinsic yet. There's no reason to report this twice;
however, you may want to open a issue on GitHub.

Best,
Cristian
Post by Dingbao Xie
Hi all,
I got an LLVM error when using klee to analyze a program generated by
clang-3.4.
I tried to debug it by myself and finally found that the error is
produced when calling
PassManager.run (klee/lib/Module/KModule.cpp, function prepare, pm3.run).
LLVM ERROR: Code generator does not support intrinsic function
'llvm.sadd.with.overflow.i32'!
Attachment is the test program that I used.
Does anyone know why LLVM produced such error and how can I get around it.
BTW I built klee with LLVM-3.4.
Thanks in advance.
--
Dingbao Xie
_______________________________________________
klee-dev mailing list
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev
Mark R. Tuttle
2014-10-20 14:17:33 UTC
Permalink
I believe the -fsanitize=undefined option turns on all checks done by
clang's undefined behavior sanitizer except for unsigned-integer-overflow.
So -fsanitize=undefined implies -fsanitize=signed-integer-overflow which
will cause clang to generate the signed llvm.*.with.overflow instrinsics
which klee does not yet support. I believe you will get the same result if
you replace -fsanitize=undefined with -fsanitize=signed-integer-overflow
itself.

See http://clang.llvm.org/docs/UsersManual.html#id30.

A handful of people on this list are interested in these intrinsics, and
from among them some implementation of these instrinsics is likely to
emerge soon.

Mark
Post by Dingbao Xie
Hi all,
I got an LLVM error when using klee to analyze a program generated by
clang-3.4.
I tried to debug it by myself and finally found that the error is produced
when calling
PassManager.run (klee/lib/Module/KModule.cpp, function prepare, pm3.run).
LLVM ERROR: Code generator does not support intrinsic function
'llvm.sadd.with.overflow.i32'!
Attachment is the test program that I used.
Does anyone know why LLVM produced such error and how can I get around it.
BTW I built klee with LLVM-3.4.
Thanks in advance.
--
Dingbao Xie
_______________________________________________
klee-dev mailing list
https://mailman.ic.ac.uk/mailman/listinfo/klee-dev
Loading...