[PATCH] ASAN: do not rewrite param for DECL_NOT_GIMPLE_REG_P.

Richard Biener richard.guenther@gmail.com
Mon May 11 12:44:22 GMT 2020


On Mon, May 11, 2020 at 1:26 PM Martin Liška <mliska@suse.cz> wrote:
>
> Hi.
>
> Starting from r11-165-geb72dc663e9070b2 we should not rewrite parameters that
> have DECL_NOT_GIMPLE_REG_P set to true.
>
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
>
> Ready to be installed?

Hmm, I think the fix is to clear DECL_NOT_GIMPLE_REG_P instead
where the code clears TREE_ADDRESSABLE of 'arg'

> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2020-05-11  Martin Liska  <mliska@suse.cz>
>
>         PR sanitizer/95033
>         * sanopt.c (sanitize_rewrite_addressable_params):
>         Do not rewrite for DECL_NOT_GIMPLE_REG_P.
>
> gcc/testsuite/ChangeLog:
>
> 2020-05-11  Martin Liska  <mliska@suse.cz>
>
>         PR sanitizer/95033
>         * g++.dg/asan/function-argument-4.C: New test.
>         * gcc.dg/asan/pr95033.c: New test.
> ---
>   gcc/sanopt.c                                  |  1 +
>   .../g++.dg/asan/function-argument-4.C         | 26 +++++++++++++++++++
>   gcc/testsuite/gcc.dg/asan/pr95033.c           | 13 ++++++++++
>   3 files changed, 40 insertions(+)
>   create mode 100644 gcc/testsuite/g++.dg/asan/function-argument-4.C
>   create mode 100644 gcc/testsuite/gcc.dg/asan/pr95033.c
>
>


More information about the Gcc-patches mailing list