From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3703F3858D28; Sat, 4 Mar 2023 18:03:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3703F3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677952980; bh=pXXuvaJPs5qF7yvC97PwPwBEAgdq+9rNirV/fp5xL2Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JscVcCI3mTY6R3LKN4OX1RLBYUiRSq7ZicJQC4uhTqbaJXSktFB1Vklm5fTTYMJcS /27U7tuU3ZoZN/KwhUmUxqRVr4/9RjM2Wx3zT08w8UBXznfgonzTMKFcPp7RrQ/yJZ XJ7puNLBBU2uQPJ32/Td4y9SD+EoHLyRPy6vAssw= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108880] [11/12 Regression] slow compilation with "-fsanitize=undefined" Date: Sat, 04 Mar 2023 18:02:58 +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 #17 from CVS Commits --- The releases/gcc-12 branch has been updated by Marek Polacek : https://gcc.gnu.org/g:6ab4c8759754f34f5285924652238c829960cd4c commit r12-9218-g6ab4c8759754f34f5285924652238c829960cd4c 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. (cherry picked from commit 1370014f2ea02ec185cf1199027575916f79fe63)=