From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 433D8385841D; Wed, 22 Feb 2023 22:47:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 433D8385841D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677106038; bh=WCHYIOQz6fSbsFq20rE0Z6R1dojRNIEDGc5jakGTeaQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jG7+AeYSRZGIGUOSRq2qVXeWYClquXtQTC47q1LCaSiTpuPfzDJHMvgWCLK1aOKAC W5tQQMxtlW1gtkscj28hn+8JA9Lx4cR/lSE2ACj/G0f1K/gpi7mAdDODwcgjJzrTZE yQyJe7+qigR9zFsn8WU4E2oatgV4g3OnaYxCPiJo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108880] [11/12/13 Regression] slow compilation with "-fsanitize=undefined" Date: Wed, 22 Feb 2023 22:47:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: compile-time-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108880 --- Comment #15 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:1370014f2ea02ec185cf1199027575916f79fe63 commit r13-6290-g1370014f2ea02ec185cf1199027575916f79fe63 Author: Marek Polacek Date: Wed Feb 22 15:17:03 2023 -0500 c-family: avoid compile-time-hog in c_genericize [PR108880] 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. PR c/108880 gcc/c-family/ChangeLog: * c-gimplify.cc (c_genericize_control_stmt) : 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.=