This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ubsan PATCH] Fix compile-time hog with &TARGET_EXPRs (PR sanitizer/70342)
- From: Marek Polacek <polacek at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 29 Apr 2016 14:35:26 +0200
- Subject: Re: [ubsan PATCH] Fix compile-time hog with &TARGET_EXPRs (PR sanitizer/70342)
- Authentication-results: sourceware.org; auth=none
- References: <20160427170325 dot GK28445 at redhat dot com> <20160428090730 dot GK26501 at tucnak dot zalov dot cz> <20160428141001 dot GP28445 at redhat dot com> <20160428141541 dot GQ26501 at tucnak dot zalov dot cz>
On Thu, Apr 28, 2016 at 04:15:41PM +0200, Jakub Jelinek wrote:
> On Thu, Apr 28, 2016 at 04:10:01PM +0200, Marek Polacek wrote:
> > That works too, though it of course affects all users, not just ubsan. Here's
>
> Of course, but I think that is a good thing ;)
>
> > the patch with your suggested change.
> >
> > Bootstrapped/regtested on x86_64-linux, ok for trunk?
> >
> > 2016-04-28 Marek Polacek <polacek@redhat.com>
> > Jakub Jelinek <jakub@redhat.com>
> >
> > PR sanitizer/70342
> > * fold-const.c (tree_single_nonzero_warnv_p): For TARGET_EXPR, use
> > TARGET_EXPR_SLOT as a base.
> >
> > * g++.dg/ubsan/null-7.C: New test.
>
> Ok for trunk.
Thanks, committed.
> For 6.2 dunno, either the same patch after a while, or perhaps your original
> patch is safer (though, wonder if e.g. one can construct a testcase where it
> will use instrument &(TARGET_EXPR <...>.field) nested many times and still
> trigger the compile time hog with your patch).
Dunno either. I think I'll backport the same patch after a week or so.
Marek