[PATCH] Do not instrument use-after-scope for vars with large alignment (PR sanitizer/82517).

Martin Liška mliska@suse.cz
Thu Oct 19 07:31:00 GMT 2017


Hi.

As discussed with Jakub, use-after-scope sanitization should not be done for variables that have bigger
alignment than MAX_SUPPORTED_STACK_ALIGNMENT. In this case, we can't put a variable to fixed stack slot.

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin

gcc/ChangeLog:

2017-10-18  Martin Liska  <mliska@suse.cz>

	PR sanitizer/82517
	* gimplify.c (gimplify_decl_expr): Do not instrument variables
	that have a large alignment.
	(gimplify_target_expr): Likewise.

gcc/testsuite/ChangeLog:

2017-10-18  Martin Liska  <mliska@suse.cz>

	PR sanitizer/82517
	* gcc.dg/asan/pr82517.c: New test.
---
 gcc/gimplify.c                      |  5 ++++-
 gcc/testsuite/gcc.dg/asan/pr82517.c | 43 +++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.dg/asan/pr82517.c


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Do-not-instrument-use-after-scope-for-vars-with-larg.patch
Type: text/x-patch
Size: 1626 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20171019/94e5df91/attachment.bin>


More information about the Gcc-patches mailing list