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 <pola...@redhat.com> > Jakub Jelinek <ja...@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. 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). Jakub