On Wed, Jul 17, 2024 at 05:45:48PM -0400, Marek Polacek wrote: > On Wed, Jul 17, 2024 at 01:37:23PM +0200, Jakub Jelinek wrote: > > On Thu, Jul 11, 2024 at 04:08:20PM -0400, Marek Polacek wrote: > > > and we ICE on the empty finally in lower_try_finally_onedest while > > > getting get_eh_else. > > > > > > Rather than checking everywhere that a GIMPLE_TRY_FINALLY is not empty, > > > I thought we could process it as if it were unreachable. > > > > I'm not sure we need to check everywhere, the only spot is get_eh_else > > from what I can see and IMHO that should be fixed with something like: > > [...] > > Okay, here's a v2 which does what you suggest: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > -- >8 -- > Here we ICE with -fsanitize=address on > > std::initializer_list x = { 1, 2, 3 }; > > since r14-8681, which removed .ASAN_MARK calls on TREE_STATIC variables. > That means that lower_try_finally now instead of > > try > { > .ASAN_MARK (UNPOISON, &C.0, 12); > x = {}; > x._M_len = 3; > x._M_array = &C.0; > } > finally > { > .ASAN_MARK (POISON, &C.0, 12); > } > > gets: > > try > { > x = {}; > x._M_len = 3; > x._M_array = &C.0; > } > finally > { > > } > > and we ICE on the empty finally in lower_try_finally_onedest while > getting get_eh_else. > > PR c++/115865 > > gcc/ChangeLog: > > * tree-eh.cc (get_eh_else): Check that the result of > gimple_seq_first_stmt is non-null. > > gcc/testsuite/ChangeLog: > > * g++.dg/asan/initlist2.C: New test.
LGTM, thanks. Jakub