From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7AA7F388B6B8; Tue, 6 Dec 2022 09:31:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7AA7F388B6B8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670319073; bh=YuqeHWNgFxt7gwwWmy514R44WjeTOgjOhkDBURWm/kE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kkSxCs+LoM+Lcvy2RW65axSWiN1gcDfgcG56WaT2udTgOURACbP0L1nqli8q/I/9K rZqxDi/1aPN+P+iVG28qjnUoKoSrEHmVOjAk+2V2mkSFvlCvWZ13IOcmMkS8ue4PxK c8o2LP8Xv2LYWI4tkg2LlJkQ0FgbAwod43KrfdZs= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/107976] ICE: SIGSEGV (stack overflow) in emit_case_dispatch_table (stmt.cc:783) with large --param=jump-table-max-growth-ratio-for-speed Date: Tue, 06 Dec 2022 09:31:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end 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: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D107976 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marxin at gcc dot gnu.org --- Comment #2 from Richard Biener --- (In reply to Andrew Pinski from comment #1) > ncases =3D tree_to_shwi (range) + 1; > labelvec =3D XALLOCAVEC (rtx, ncases); > memset (labelvec, 0, ncases * sizeof (rtx)); >=20 >=20 > I think this is a won't fix. > Doctor, it hurts when I bend my arm this way. > Don't bend it that way then. Changing the above to heap allocation would be easy - of course we'd genera= te a huge number of labels then which eventually will lead to different issues. Using heap allocation or an auto_vec and capping the maximum of jump-table-max-growth-ratio-for-{size,speed} to something sensible (the defaults are 300 and 800) would be appropriate I think.=