Do not handled volatile arguments (PR sanitizer/82484).

2018-03-01  Martin Liska  <mliska@suse.cz>

	PR sanitizer/82484
	* sanopt.c (sanitize_rewrite_addressable_params): Do not handle
	volatile arguments.
2018-03-01  Martin Liska  <mliska@suse.cz>

	PR sanitizer/82484
	* gcc.dg/asan/pr82484.c: New test.

From-SVN: r258101
This commit is contained in:
Martin Liska 2018-03-01 15:54:10 +01:00 committed by Martin Liska
parent b476f5dd5d
commit 99daa7a9ee
4 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2018-03-01 Martin Liska <mliska@suse.cz>
PR sanitizer/82484
* sanopt.c (sanitize_rewrite_addressable_params): Do not handle
volatile arguments.
2018-03-01 Richard Biener <rguenther@suse.de>
PR debug/84645

View File

@ -1143,7 +1143,9 @@ sanitize_rewrite_addressable_params (function *fun)
arg; arg = DECL_CHAIN (arg))
{
tree type = TREE_TYPE (arg);
if (TREE_ADDRESSABLE (arg) && !TREE_ADDRESSABLE (type)
if (TREE_ADDRESSABLE (arg)
&& !TREE_ADDRESSABLE (type)
&& !TREE_THIS_VOLATILE (arg)
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST)
{
TREE_ADDRESSABLE (arg) = 0;

View File

@ -1,3 +1,8 @@
2018-03-01 Martin Liska <mliska@suse.cz>
PR sanitizer/82484
* gcc.dg/asan/pr82484.c: New test.
2018-03-01 Richard Biener <rguenther@suse.de>
PR debug/84645

View File

@ -0,0 +1,5 @@
/* PR sanitizer/82484 */
/* { dg-do compile } */
void foo(volatile int *ptr);
void a (volatile int b) { foo(&b); }