[cfe-dev] A problem met during using -ftrapv

Eli Friedman eli.friedman at gmail.com
Fri May 28 02:38:55 PDT 2010


On Fri, May 28, 2010 at 12:28 AM, peng li <peterlee at cs.utah.edu> wrote:
> Hi There
>
> When I tried to compile a simple program shown as follows using this
> command: clang -o add add.c -ftrapv
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <stdint.h>
>
> void overflow_handler(long long a, long long b, char c, char d) {
>   printf("overflow occurs!\n");
> }
>
> void (*__overflow_handler)(long long, long long, char, char) =
> overflow_handler;
>
> int main(void) {
>   int64_t test = INT64_MAX + 1;
>   printf("test: %lld\n", test);
> }
>
> I got the following error message:
> clang: X86ISelLowering.cpp:7726: virtual void
> llvm::X86TargetLowering::ReplaceNodeResults(llvm::SDNode*,
> llvm::SmallVectorImpl<llvm::SDValue>&, llvm::SelectionDAG&) const:
> Assertion `false && "Do not know how to custom type legalize this
> operation!"' failed.

Looks like the x86-32 backend doesn't handle
@llvm.sadd.with.overflow.i64 correctly; please file in Bugzilla.

-Eli




More information about the cfe-dev mailing list