From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id ABB3C385840E for ; Wed, 24 Nov 2021 10:16:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ABB3C385840E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: RpFN2cDejroXJy9iyPiEfqySYndst5zX4/bU321A8UMFGxp2gHpJUpXroLv0fM/mknCBiJ+3Tn W3yT6EpWGOzJ32MjdL6m3+sprmlckBjj0SOtu5+4cM1iWSZ+lTqjVmdAfDmS8DgK0/5jTG3jmx pqVf7D9hYevLsgBHL2OhRui3bwwlVuD7D6keYHAS579ffF3YSsSch3qMUEH0f2ke9mF2dkmwAB nom4dVJ56Vf2ZnU7JtWsklYET0uCl09hwis/0Xgj6DzozGf+09tbKT30GigGfWbfO9NYZavKe9 tqz5684PJEmlvHOx6s4u4rM5 X-IronPort-AV: E=Sophos;i="5.87,260,1631606400"; d="scan'208";a="71361497" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 24 Nov 2021 02:16:28 -0800 IronPort-SDR: NNnjkU5t57hC+HYqB9EOlU8+xy3KvCkFw3FEb0Ev9A6ByYcNgYuoE5ohoeOKGKRdXOTTr2RZBu jE7mepbBZ054rFg4WiE3sTjuvyWHbSKmTV8V+NRN05idlO6qR+wZrRfzzUUO4u5M6vlickQkUY saXCATl+9ORbv9/YhCkHvUKA4aBLUMsxOYTyOTNc+a1tMzLx3k5k0aizi4mYyECkwy29p8LYMR tLSJDiMcxB7LRcOdm6W34phEcq023lT72v+avkgmRkFhJHFSYw4zFkgwDxkPzSDbElGIirr8jx +Y4= From: Thomas Schwinge To: Martin Sebor , CC: Subject: Re: [PATCH] implement -Winfinite-recursion [PR88232] In-Reply-To: References: User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Wed, 24 Nov 2021 11:16:20 +0100 Message-ID: <87zgptsvt7.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Nov 2021 10:16:30 -0000 Hi! On 2021-11-09T21:28:43-0700, Martin Sebor via Gcc-patches wrote: > The attached patch adds support to the middle end for detecting > infinitely recursive calls. The warning is controlled by the new > -Winfinite-recursion option. The option name is the same as > Clang's. Thanks! > The warning detects a superset of problems detected by Clang > (based on its tests). It detects the problem in PR88232 > (the feature request) as well as the one in PR 87742, > an unrelated problem report that was root-caused to bug due > to infinite recursion. ... and I'm thus confirming that it also would have caught PR101204 "infinite recursion in gtype-desc.c since r12-1801-g7036e9ef462fde8181bece4ac4e03f3aa27204dc": [...] gtype-desc.c: In function =E2=80=98void gt_pch_nx(int_hash*, gt_pointer_operator, void*)=E2=80=99: gtype-desc.c:11311:1: error: infinite recursion detected [-Werror=3Dinf= inite-recursion] 11311 | gt_pch_nx (int_hash* x ATTRIBUTE_UNUSED, | ^~~~~~~~~ gtype-desc.c:11315:15: note: recursive call 11315 | gt_pch_nx (&((*x)), op, cookie); | ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors make[3]: *** [gtype-desc.o] Error 1 make[3]: Leaving directory `[...]/build-gcc/gcc' make[2]: *** [all-stage2-gcc] Error 2 make[2]: Leaving directory `[...]/build-gcc' make[1]: *** [stage2-bubble] Error 2 make[1]: Leaving directory `[...]/build-gcc' make: *** [all] Error 2 That's with recent fix-up commit c71cb26a9e841888f52e4bfcaad94c8f8ecb4fdb "Get rid of infinite recursion for 'typedef' used with GTY-marked 'gcc/diagnostic-spec.h:nowarn_map' [PR101204, PR103157]" temporarily reverted (and commit f861ed8b29a5eb6164d1ddbcfbb6232dddae713f "Use 'location_hash' for 'gcc/diagnostic-spec.h:nowarn_map'" as a prerequisite, too). Gr=C3=BC=C3=9Fe Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955