From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 35E2B385770F; Wed, 17 May 2023 18:58:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35E2B385770F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684349913; bh=wVW6Xq2jZizKuanDeUpQtYJV8iyXG/QRdoQa750gkHs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fgwE1sT267Nabc8gFJB9SZtAhMRqAhGguQCgRq2b94l43ErHKY3daAInCUJGRVLQ6 fTwmhWBwfMdlCxstm8HoqxswtLqn+RFNhbx1YDlBCqD3ZptYayOIJ8mV0Zw0596uaG I/X/ZkkL6zWr2phl0g0HpfwCRhEUtEjy6B9f8I+c= From: "thiago at kde dot org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyB0cmVlLW9wdGltaXphdGlvbi8xMDY0MDldIEdDQyB3aXRo?= =?UTF-8?B?IExUTzogV2FybmluZzogYXJndW1lbnQgMSB2YWx1ZSDigJgxOC4uLjYxNQ==?= =?UTF-8?B?4oCZIChTSVpFX01BWCkgZXhjZWVkcyBtYXhpbXVtIG9iamVjdCBzaXplIHdp?= =?UTF-8?B?dGggbmV3?= Date: Wed, 17 May 2023 18:58: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: 11.1.0 X-Bugzilla-Keywords: diagnostic, lto X-Bugzilla-Severity: normal X-Bugzilla-Who: thiago at kde dot 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: --- 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=3D106409 --- Comment #8 from Thiago Macieira --- (In reply to Andrew Pinski from comment #7) > See PR 58525 also which added that code path. That explains why it won't call __cxa_throw_bad_array_new_length, but not w= hy it will call operator new[](-1). My suggestion is to keep __cxa_throw_bad_array_new_length for the exceptions case and add a new func= tion for the non-exceptional case. This function could: * call operator new[], which would probably cause the stack unwinder to terminate the application * call std::terminate() directly, possibly after printing something to stde= rr * return null pointer * something else (generate debug break, raise(SIGKILL), etc.)=