This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Properly honor no_sanitize_undefined attribute
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 30 Jun 2014 15:00:11 +0200
- Subject: Re: [PATCH] Properly honor no_sanitize_undefined attribute
- Authentication-results: sourceware.org; auth=none
- References: <20140630120826 dot GA20427 at redhat dot com> <20140630125853 dot GM31640 at tucnak dot redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jun 30, 2014 at 02:58:53PM +0200, Jakub Jelinek wrote:
> On Mon, Jun 30, 2014 at 02:08:26PM +0200, Marek Polacek wrote:
> > Apparently I didn't pay much attention to no_sanitize_undefined
> > attribute when adding new features to ubsan, so we would instrument
> > stuff even though the function is marked with this attribute.
> > Thus fixed & new testcases added.
> >
> > Bootstrapped/regtested on x86_64-linux, ok for trunk?
> >
> > 2014-06-30 Marek Polacek <polacek@redhat.com>
> >
> > * convert.c (convert_to_integer): Don't instrument conversions if the
> > function has no_sanitize_undefined attribute.
> > * ubsan.c: Don't run the ubsan pass if the function has
> > no_sanitize_undefined attribute.
> > c/
> > * c-decl.c (grokdeclarator): Don't instrument VLAs if the function
> > has no_sanitize_undefined attribute.
> > cp/
> > * cp-gimplify.c (cp_genericize): Don't instrument returns if the
> > function has no_sanitize_undefined attribute.
> > * decl.c (compute_array_index_type): Don't instrument VLAs if the
> > function has no_sanitize_undefined attribute.
> > testsuite/
> > * c-c++-common/ubsan/attrib-2.c: New test.
> > * g++.dg/ubsan/return-3.C: New test.
>
> Ok, thanks.
Actually, please change current_function_decl != 0 to
current_function_decl != NULL_TREE everywhere in the patch.
Ok with that change.
Jakub