From ed89e76a35f8dc067b747a57a143d2d74516afc4 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 11 Oct 2017 14:29:13 +0200 Subject: [PATCH] Revert last commit. From-SVN: r253638 --- gcc/ChangeLog | 8 ++++++++ gcc/sanopt.c | 4 +--- gcc/testsuite/ChangeLog | 7 +++++++ gcc/testsuite/gcc.dg/asan/pr82484.c | 5 ----- 4 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 gcc/testsuite/gcc.dg/asan/pr82484.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6b02c6216bb..2eecadbc981 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-10-11 Martin Liska + + Revert r253637: + + PR sanitizer/82484 + * sanopt.c (sanitize_rewrite_addressable_params): Do not handle + volatile arguments. + 2017-10-11 Martin Liska PR sanitizer/82484 diff --git a/gcc/sanopt.c b/gcc/sanopt.c index 019cf9fa81c..997bcfd3df7 100644 --- a/gcc/sanopt.c +++ b/gcc/sanopt.c @@ -1140,9 +1140,7 @@ sanitize_rewrite_addressable_params (function *fun) arg; arg = DECL_CHAIN (arg)) { tree type = TREE_TYPE (arg); - if (TREE_ADDRESSABLE (arg) - && !TREE_ADDRESSABLE (type) - && !TREE_THIS_VOLATILE (arg) + if (TREE_ADDRESSABLE (arg) && !TREE_ADDRESSABLE (type) && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST) { TREE_ADDRESSABLE (arg) = 0; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b6093d079ea..1f51a7217bc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2017-10-11 Martin Liska + + Revert r253637: + + PR sanitizer/82484 + * gcc.dg/asan/pr82484.c: New test. + 2017-10-11 Martin Liska PR sanitizer/82484 diff --git a/gcc/testsuite/gcc.dg/asan/pr82484.c b/gcc/testsuite/gcc.dg/asan/pr82484.c deleted file mode 100644 index f8051bd300c..00000000000 --- a/gcc/testsuite/gcc.dg/asan/pr82484.c +++ /dev/null @@ -1,5 +0,0 @@ -/* PR sanitizer/82484 */ -/* { dg-do compile } */ - -void foo(volatile int *ptr); -void a (volatile int b) { foo(&b); } -- 2.30.2