From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.schemamania.org (050-075-019-234.biz.spectrum.com [50.75.19.234]) by sourceware.org (Postfix) with ESMTP id 3117C3858D20 for ; Thu, 14 Dec 2023 17:08:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3117C3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=schemamania.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=schemamania.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3117C3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=50.75.19.234 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702573694; cv=none; b=mBwocQPVdHOE6VPGsu6/wYv/KOs1A+vh0mCxmSy7mpvl9+9fr7DW8XyZzjUXTyHW5JTj/h2s7JIafyJGNcEMF2sun3VStfEpBg3MCbDUb72hvt+VFudHdGWB3xWzkzM9UxtydFHRONIWl2pV17l9bIri5n7+pC8duKGPX5c2HMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702573694; c=relaxed/simple; bh=pVkucXoR25qYrETFZBbQRHBFRnOcN623qMRsK5y3Zuc=; h=Date:From:To:Subject:Message-Id:Mime-Version; b=HbD+YtCIzE3gJkwAkVuuzQ3fFK2kty8xQebPHPGN2JsqH02S1N/cmRS4GxgP6wMsZ/q3mH1gn7GnGY3t9sn3wWm0Tg3wT8GoUckmiFGefJ51IfMYKGeYBSNX6juL97CCDUVHZ4MuQt/ais7Ej/oBXqu91LyKRTkpAhIbgNCAZL4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from oak.schemamania.org (localhost [IPv6:::1]) by mail.schemamania.org (Postfix) with ESMTP id EC29F256FAFF; Wed, 13 Dec 2023 13:49:44 -0500 (EST) Date: Wed, 13 Dec 2023 13:49:44 -0500 From: "James K. Lowden" To: gcc@gcc.gnu.org Cc: David Brown Subject: Re: issue: unexpected results in optimizations Message-Id: <20231213134944.7b49a899e145eaf1e4e8fcf5@schemamania.org> In-Reply-To: References: X-Mailer: Sylpheed 3.4.3 (GTK+ 2.24.28; x86_64--netbsd) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DATE_IN_PAST_12_24,KAM_DMARC_STATUS,NICE_REPLY_A,RDNS_DYNAMIC,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 Tue, 12 Dec 2023 09:39:58 +0100 David Brown via Gcc wrote: > If you have fixed the immediate problems in the code, add the > "-fsanitize=undefined" flag before running it. That will do run-time > undefined behaviour checks. I would like to understand that better, for reasons you might guess. -fsanitize is described under Program Instrumentation Options, but much of the terminology seems to C, and some of the options are documented to work only with C or C++. If it applies to the generated code irrespective of the front-end, then could the options be described in terms of Generic? For example, signed-integer-overflow, bounds, and bounds-strict would seem to be useful in any language that defines integers and arrays. I also wonder if "integer" includes _Float128. "-fsanitize" appears only once in the Internals document, under bool TARGET_MEMTAG_CAN_TAG_ADDRESSES If I knew when contructs were needed for particular options to work, I could add them to the documentation. --jkl