aboutsummaryrefslogtreecommitdiff
path: root/gcc/sanopt.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-05-12 10:23:09 +0200
committerMartin Liska <mliska@suse.cz>2020-05-12 10:23:09 +0200
commit6b41920bd5c68998a53de749b4fe5c0b8875db6c (patch)
tree3c6f8e229818dbe1a6860972f0c0d0a9e02ad9f6 /gcc/sanopt.c
parent99b0c9ec47d563d1f780cb678c04d37c9835440f (diff)
downloadgcc-6b41920bd5c68998a53de749b4fe5c0b8875db6c.zip
gcc-6b41920bd5c68998a53de749b4fe5c0b8875db6c.tar.gz
gcc-6b41920bd5c68998a53de749b4fe5c0b8875db6c.tar.bz2
ASAN: clear DECL_NOT_GIMPLE_REG_P.
PR sanitizer/95033 PR sanitizer/95051 * sanopt.c (sanitize_rewrite_addressable_params): Clear DECL_NOT_GIMPLE_REG_P for argument. PR sanitizer/95033 PR sanitizer/95051 * g++.dg/asan/function-argument-4.C: New test. * gcc.dg/asan/pr95033.c: New test. * gcc.dg/asan/pr95051.c: New test.
Diffstat (limited to 'gcc/sanopt.c')
-rw-r--r--gcc/sanopt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/sanopt.c b/gcc/sanopt.c
index 86180e3..6c3bce9 100644
--- a/gcc/sanopt.c
+++ b/gcc/sanopt.c
@@ -1158,6 +1158,7 @@ sanitize_rewrite_addressable_params (function *fun)
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST)
{
TREE_ADDRESSABLE (arg) = 0;
+ DECL_NOT_GIMPLE_REG_P (arg) = 0;
/* The parameter is no longer addressable. */
has_any_addressable_param = true;