From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5B3B8383FBB9; Mon, 13 Feb 2023 14:57:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B3B8383FBB9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676300253; bh=QOsVjPop0Qo+c81uT2hmhAzsX54BOJky5S3OXNblMR0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mSTN8N+7a5ccjYaE7FQwlGHjbP/Bijnbt4ogjeq+UPlNtDw13r1JUpZ8CtJbbJ2ac u1GF4lLJ8bcPZosW9AypXwawTwt68ftmWg1DtXWvOvRKDtal4jChEEDEUM+Yn9ym49 ZYdKwcDI2KxAuWq2u6qVpYEzhI7UvIv+2joAMNPo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108691] [13 Regression] ICE with function ptr and setjmp/returns twice at -O1 Date: Mon, 13 Feb 2023 14:57:32 +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: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth 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=3D108691 --- Comment #9 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:6436add49ed9ecf74f1f01b4fe18961df4f3e83d commit r13-5965-g6436add49ed9ecf74f1f01b4fe18961df4f3e83d Author: Richard Biener Date: Mon Feb 13 10:41:51 2023 +0100 tree-optimization/108691 - indirect calls to setjmp DCE now chokes on indirect setjmp calls becoming direct because that exposes them too late to be subject to abnormal edge creation. The following patch honors gimple_call_ctrl_altering for those and _not_ treat formerly indirect calls to setjmp as calls to setjmp in notice_special_calls. Unfortunately there's no way to have an indirect call to setjmp properly annotated (the returns_twice attribute is ignored on types). RTL expansion late discovers returns-twice for the purpose of adding REG_SETJMP notes and also sets ->calls_setjmp (instead of asserting it is set). There's no good way to transfer proper knowledge around here so I'm using ->calls_setjmp as a flag to indicate whether gimple_call_ctrl_altering_p was set. PR tree-optimization/108691 * tree-cfg.cc (notice_special_calls): When the CFG is built honor gimple_call_ctrl_altering_p. * cfgexpand.cc (expand_call_stmt): Clear cfun->calls_setjmp temporarily if the call is not control-altering. * calls.cc (emit_call_1): Do not add REG_SETJMP if cfun->calls_setjmp is not set. Do not alter cfun->calls_setjmp. * gcc.dg/pr108691.c: New testcase.=