From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sourceware.org (Postfix) with ESMTPS id BC79F3858298 for ; Mon, 20 Feb 2023 11:18:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BC79F3858298 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:reply-to:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=ruY3X8pnGQXBYbcy/wrUXWQ8MN+TrBHoi1xkxddIVhk=; b=BQwYqPwT/bIkNUV2NpOHGFyJjdd0u2EAMv/21zb8C1oaSPArHsKhg1Tx uWnGs+8juuvvHwXA3qQgYoU453/vNgN34s8gNt5mpTK6pqEwssdGWgDRm zdIyITwfn0HXmc0d9VI5yyWJgNDRLwBORD7hvhFaV+vePcdYonipSKcuU w=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=marc.glisse@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.97,312,1669071600"; d="scan'208";a="48162805" Received: from 85-171-189-19.rev.numericable.fr (HELO hippo) ([85.171.189.19]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2023 12:18:38 +0100 Date: Mon, 20 Feb 2023 12:18:36 +0100 (CET) From: Marc Glisse Reply-To: gcc-help@gcc.gnu.org To: Gabriel Ravier cc: Xi Ruoyao , Jonathan Wakely , Jonny Grant , gcc-help Subject: Re: std::string add nullptr attribute In-Reply-To: Message-ID: <7e54f0b6-0c58-e340-46a3-b46fa321a201@inria.fr> References: <7e6e3bbf-0dac-0632-0e8f-372bd32a6923@jguk.org> <6e30ed8e6c6f08407a5b8259e73fd18a492376b5.camel@xry111.site> <8cfbab8b-07e8-7dab-c829-6de77cc8cf39@jguk.org> <6b530d67-723a-a0c9-15bc-12b7341653a7@jguk.org> <96f99315a6ffd3dd3919b23a4ade2597747a580a.camel@xry111.site> <1e62a6f51b748454abe88438f2040486722c5803.camel@xry111.site> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 20 Feb 2023, Gabriel Ravier via Gcc-help wrote: > This is the kind of thing that makes me wonder why there isn't some kind of > `__builtin_unreachable_do_not_optimize()` builtin that allows one to mark > places in code that should never be reached and should thus be warned about > if such a thing happens while at the same time never doing any optimization > on the basis of the presence of the call. -fsanitize=unreachable -fsanitize=null and others prevent the kind of optimization you are worried about. -- Marc Glisse