On Wed, Feb 22, 2023 at 05:37:45PM -0500, Marek Polacek wrote: > This fixes a compile-time hog with UBSan. This only happened in cc1 but > not cc1plus. The problem is ultimately that c_genericize_control_stmt/ > STATEMENT_LIST -> walk_tree_1 doesn't use a hash_set to remember visited > nodes, so it kept on recursing for a long time. We should be able to > use the pset that c_genericize created. We just need to use walk_tree > instead of walk_tree_w_d so that the pset is explicit. > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > PR c/108880 > > gcc/c-family/ChangeLog: > > * c-gimplify.cc (c_genericize_control_stmt) <case STATEMENT_LIST>: Pass > pset to walk_tree_1. > (c_genericize): Call walk_tree with an explicit pset. > > gcc/testsuite/ChangeLog: > > * c-c++-common/ubsan/pr108880.c: New test.
Ok, thanks. Jakub