On Tue, Jul 10, 2018 at 10:01:10AM +0200, Richard Biener wrote: > On Tue, 10 Jul 2018, Jakub Jelinek wrote: > > cp_maybe_instrument_return is looking for a return stmt at the end of > > function to decide whether to omit -fsanitize=return instrumentation or > > __builtin_unreachable addition. If a STATEMENT_LIST has a return followed > > by DEBUG_BEGIN_STMT (or multiple of them), it doesn't find the return > > though. > > > > Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for > > trunk? > > OK. This also affects the branch?
8.x only, will commit it there too. > > 2018-07-10 Jakub Jelinek <ja...@redhat.com> > > > > PR sanitizer/86406 > > * cp-gimplify.c (cp_maybe_instrument_return): Skip trailing > > DEBUG_BEGIN_STMTs. > > > > * g++.dg/ubsan/pr86406.C: New test. Jakub