From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by sourceware.org (Postfix) with ESMTPS id 0B62D385841D for ; Mon, 31 Jan 2022 10:25:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B62D385841D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nefkom.net Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4JnPN40J27z1r4Hd; Mon, 31 Jan 2022 11:25:39 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4JnPN35WCqz1qqkB; Mon, 31 Jan 2022 11:25:39 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id PcQ1KZ7SD9uY; Mon, 31 Jan 2022 11:25:38 +0100 (CET) X-Auth-Info: VgGnYH2WDZhFTqNiYrL3CD/9im6l4c3qf8IEzbKYkemf9dtOLTn5I0y79oU7YHb3 Received: from igel.home (ppp-46-244-168-119.dynamic.mnet-online.de [46.244.168.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 31 Jan 2022 11:25:38 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id 5AA4D2C3779; Mon, 31 Jan 2022 11:25:38 +0100 (CET) From: Andreas Schwab To: Jonathan Wakely via Gcc Cc: Jakub Jelinek , Jonathan Wakely , Theodore Papadopoulo Subject: Re: Enquiry References: <20220130104145.GC2646553@tucnak> <20220130105822.GD2646553@tucnak> X-Yow: Are you still an ALCOHOLIC? Date: Mon, 31 Jan 2022 11:25:38 +0100 In-Reply-To: (Jonathan Wakely via Gcc's message of "Sun, 30 Jan 2022 11:11:15 +0000") Message-ID: <87czk86w2l.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Jan 2022 10:25:42 -0000 On Jan 30 2022, Jonathan Wakely via Gcc wrote: > On Sun, 30 Jan 2022, 10:58 Jakub Jelinek, wrote: > >> On Sun, Jan 30, 2022 at 10:50:56AM +0000, Jonathan Wakely wrote: >> > We could put a trap instruction at the end of the function though, which >> > would make the result a bit less arbitrary. >> > >> > I've come around to thinking that's preferable for cases like this. >> >> Depends on which exact cases. >> Because for >> int foo (int s) { if (s == 123) return 1; } >> we want to optimize it into >> return 1; >> rather than if (s == 123) return 1; else __builtin_trap (); >> For debugging we have -fsanitize=undefined > > > What if we inserted the trap for -O0? Note that in C it is not an error to fall through the end of a non-void function if the caller does not use the return value. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."