The problem in this PR is that we were leaking C_MAYBE_CONST_EXPRs into the
gimplifier. It was created in the float-cast instrumentation in convert().
Fixed by using the fully-folded EXPR only, thus without C_MAYBE_CONST_EXPR.
Which means that we can drop a parameter of ubsan_instrument_float_cast.
Seems that this doesn't hurt the diagnostics.
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2016-01-05 Marek Polacek <polacek@redhat.com>
PR sanitizer/69099
* c-convert.c (convert) [INTEGER_TYPE]: Drop ARG. Don't pass ARG to
ubsan_instrument_float_cast. Fold EXPR.
* convert.c (convert_to_integer_1): Adjust call to
ubsan_instrument_float_cast.
* ubsan.c (ubsan_instrument_float_cast): Drop the ARG parameter. Use
EXPR instead of ARG.
* ubsan.h (ubsan_instrument_float_cast): Adjust declaration.
* gcc.dg/ubsan/float-cast-overflow-atomic.c: New test.