diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-09 21:23:58 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-02-09 21:23:58 +0000 |
commit | 4e2f4ed59eb753e0c23d31db31cf5fb59b97f883 (patch) | |
tree | 1ca21e0d206ad1ed93a5fbce4c51308411f4589d /gcc/builtins.c | |
parent | 4686160906ada1996221da06b3e27ec6a72c7c31 (diff) |
PR sanitizer/64981
* builtins.c (expand_builtin): Call targetm.expand_builtin
for BUILT_IN_MD builtins regardless of asan_intercepted_p.
* gcc.dg/asan/pr64981.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220551 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index 3ddaddc1ab0..8f3c0bc22b3 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -5960,6 +5960,9 @@ expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode, machine_mode target_mode = TYPE_MODE (TREE_TYPE (exp)); int flags; + if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) + return targetm.expand_builtin (exp, target, subtarget, mode, ignore); + /* When ASan is enabled, we don't want to expand some memory/string builtins and rely on libsanitizer's hooks. This allows us to avoid redundant checks and be sure, that possible overflow will be detected @@ -5968,9 +5971,6 @@ expand_builtin (tree exp, rtx target, rtx subtarget, machine_mode mode, if ((flag_sanitize & SANITIZE_ADDRESS) && asan_intercepted_p (fcode)) return expand_call (exp, target, ignore); - if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) - return targetm.expand_builtin (exp, target, subtarget, mode, ignore); - /* When not optimizing, generate calls to library functions for a certain set of builtins. */ if (!optimize |