aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-streamer-in.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-01-27 19:48:30 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-01-27 19:48:30 +0100
commit8f91e6e0eff1494cfefb2129876847aab5748538 (patch)
tree368b5c8a00ed9b3e4a5b5d67306390a2880e97da /gcc/tree-streamer-in.c
parentede673766742e2e48e43e3fa1c08c86d2ca8c893 (diff)
downloadgcc-8f91e6e0eff1494cfefb2129876847aab5748538.zip
gcc-8f91e6e0eff1494cfefb2129876847aab5748538.tar.gz
gcc-8f91e6e0eff1494cfefb2129876847aab5748538.tar.bz2
re PR lto/69254 (ICE in streamer_get_builtin_tree when using -fsanitize=shift on the compile side only)
PR lto/69254 * sanitizer.def: Add BEGIN_SANITIZER_BUILTINS and END_SANITIZER_BUILTINS markers using DEF_BUILTIN_STUB. * asan.c (DEF_BUILTIN_STUB): Temporarily define. * tree-streamer-in.c: Include asan.h. (streamer_get_builtin_tree): For builtins in sanitizer range call initialize_sanitizer_builtins and retry. From-SVN: r232891
Diffstat (limited to 'gcc/tree-streamer-in.c')
-rw-r--r--gcc/tree-streamer-in.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c
index 3c8558e..91c72eb 100644
--- a/gcc/tree-streamer-in.c
+++ b/gcc/tree-streamer-in.c
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "builtins.h"
#include "ipa-chkp.h"
#include "gomp-constants.h"
+#include "asan.h"
/* Read a STRING_CST from the string table in DATA_IN using input
@@ -1136,13 +1137,21 @@ streamer_get_builtin_tree (struct lto_input_block *ib, struct data_in *data_in)
fatal_error (input_location,
"machine independent builtin code out of range");
result = builtin_decl_explicit (fcode);
- if (!result
- && fcode > BEGIN_CHKP_BUILTINS
- && fcode < END_CHKP_BUILTINS)
+ if (!result)
{
- fcode = (enum built_in_function) (fcode - BEGIN_CHKP_BUILTINS - 1);
- result = builtin_decl_explicit (fcode);
- result = chkp_maybe_clone_builtin_fndecl (result);
+ if (fcode > BEGIN_CHKP_BUILTINS && fcode < END_CHKP_BUILTINS)
+ {
+ fcode = (enum built_in_function)
+ (fcode - BEGIN_CHKP_BUILTINS - 1);
+ result = builtin_decl_explicit (fcode);
+ result = chkp_maybe_clone_builtin_fndecl (result);
+ }
+ else if (fcode > BEGIN_SANITIZER_BUILTINS
+ && fcode < END_SANITIZER_BUILTINS)
+ {
+ initialize_sanitizer_builtins ();
+ result = builtin_decl_explicit (fcode);
+ }
}
gcc_assert (result);
}