From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 013F13858D28; Thu, 19 Jan 2023 07:43:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 013F13858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674114191; bh=dLr+yT3IdP2G8xCIM81hW3X50QhRPT1/htBSjcAorbg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=w5vnYLjP7Z9/QxTis7KNLw3lHYDFwDPfR8v5F1PHlzFmugjRqePj2wcWsndmDkwhw mVGFmCs4IX0UcWkKS3iJED8y6nBGlXOHWblyaUSoQDz1fUZglkmfWqbEysjgHLL+j+ 4HAyKsC7IYucTwd+120D7K36eDV+aQTwuH7JkZzM= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108449] [13 Regression] ICE in eliminate_unnecessary_stmts, at tree-ssa-dce.cc:1512 Date: Thu, 19 Jan 2023 07:43:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D108449 --- Comment #2 from Richard Biener --- OK, so early we still have vfork() 'static' and maybe_special_function_p returns false. But then check_global_declaration () comes along and does /* Warn about any function declared static but not defined. We don't warn about variables, because many programs have static variables that exist only to get some text into the object file. */ if (TREE_CODE (decl) =3D=3D FUNCTION_DECL && DECL_INITIAL (decl) =3D=3D 0 && DECL_EXTERNAL (decl) && ! DECL_ARTIFICIAL (decl) && ! TREE_PUBLIC (decl)) { if (warning_suppressed_p (decl, OPT_Wunused)) ; else if (snode->referred_to_p (/*include_self=3D*/false)) pedwarn (input_location, 0, "%q+F used but never defined", decl); else warning (OPT_Wunused_function, "%q+F declared % but never " "defined", decl); /* This symbol is effectively an "extern" declaration now. */ TREE_PUBLIC (decl) =3D 1; which will result in maybe_special_function_p to return true. I suppose leaving the decl static might have an effect on the linker errors emitted for targets that require special asm ops for undefined external references, but then you should still get an error here. This mangling dates back to RMS at r0-3845-g7d429c41c5953f=