From: Jakub Jelinek Date: Fri, 1 Jan 2016 11:55:02 +0000 (+0100) Subject: re PR sanitizer/69055 (Internal compiler error -fsanitize=float-cast-overflow) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=10dff63f98807e6b7f65c9c3b9f69623f8f619b3;p=gcc.git re PR sanitizer/69055 (Internal compiler error -fsanitize=float-cast-overflow) PR sanitizer/69055 * ubsan.c (ubsan_instrument_float_cast): Call initialize_sanitizer_builtins. * gfortran.dg/pr69055.f90: New test. From-SVN: r232024 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 32d3ecf545e..8f67593969f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2016-01-01 Jakub Jelinek + PR sanitizer/69055 + * ubsan.c (ubsan_instrument_float_cast): Call + initialize_sanitizer_builtins. + PR target/69015 * ifcvt.c (find_cond_trap): Give up if returnjump_p (jump). diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 178c13ee2d9..3de98fbbca1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2016-01-01 Jakub Jelinek + PR sanitizer/69055 + * gfortran.dg/pr69055.f90: New test. + PR target/69015 * gcc.dg/pr69015.c: New test. diff --git a/gcc/testsuite/gfortran.dg/pr69055.f90 b/gcc/testsuite/gfortran.dg/pr69055.f90 new file mode 100644 index 00000000000..48b34424608 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr69055.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! { dg-options "-fsanitize=float-cast-overflow" } + +subroutine pr69055 + implicit none + integer :: n + real(8) :: b + b = huge(1.0D0) + n = b +end subroutine pr69055 diff --git a/gcc/ubsan.c b/gcc/ubsan.c index 6fc6233c035..522967a22a0 100644 --- a/gcc/ubsan.c +++ b/gcc/ubsan.c @@ -1588,6 +1588,7 @@ ubsan_instrument_float_cast (location_t loc, tree type, tree expr, tree arg) { location_t *loc_ptr = NULL; unsigned num_locations = 0; + initialize_sanitizer_builtins (); /* Figure out if we can propagate location to ubsan_data and use new style handlers in libubsan. */ if (ubsan_use_new_style_p (loc))