From patchwork Sun Nov 9 21:53:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123855 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 664BB3858D33 for ; Sun, 9 Nov 2025 22:11:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 664BB3858D33 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=eAq6+f/W X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [IPv6:2600:3c04:e001:324:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id 03B183858C31 for ; Sun, 9 Nov 2025 21:53:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 03B183858C31 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 03B183858C31 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c04:e001:324:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725218; cv=none; b=E/MMw1+KbxMw++FUCY09sVgeI7bwymmZU/rr7M3ZbNB2Ca9zVDnzZft5ghuFubqU3phkAOc+DtlDQlqBoy5nS6VsZp+YrSYlwXh/zPkh4xRcxbpWe7ATVjXinxK7JqoRzdPmF3f6lbqF/r82rS1lVhrb3oD+pihQDO69imozaDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725218; c=relaxed/simple; bh=7ZzKgS1nTEdKZ7xJ0tduhGvlkd4d7i8pwxFcdOHvDvs=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Y/xBx1qHJ5Ey/lehpXA5N8pjTZ165qCq3SY6BCXlGBudqKkG5tX29hppbp2R4wwUdmNezPOIsEZWltEnR+RjqtVI00u0CYYTMWVGt9lXlRQokVqA6s5ukd0zmbRK3RtJR0+BYYs8gofOFONOLeOP4iupN2+9FXGlRgAGZ5qDES8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03B183858C31 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id A22B460051 for ; Sun, 9 Nov 2025 21:53:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EEB1C116B1; Sun, 9 Nov 2025 21:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725217; bh=7ZzKgS1nTEdKZ7xJ0tduhGvlkd4d7i8pwxFcdOHvDvs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eAq6+f/W/UnJEOwmdgcFagODOICxodstbTn+WcykQO8m2LyIeQ5GHFU+b8JqAcVUA BI2Ssq16ar2gbUjghvrGhPiOfAXPJVIRhTMEH3uHY9Npcn64G1aMI0WilXUWXPbzVq B/XnhMIxC05ALNkNKakeYQByg22Y/t68JFlASXD+UDKhMMJdehwTeeGQdi5yH/KDvo RXuIOZmm5b81IP1wzoBxZVljNpC72JYTOhuXTutSZF0NjH2tyAIfIkJnCLffdPxYLA 8rV5Mxj+FtrKe6JLzJgx8WbvXSWFvU5nBOulkMtpTmPsxz5Ju3nP8Wk6hUru9i5g9T AAWhIxh1aT63w== Date: Sun, 9 Nov 2025 22:53:34 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 19/35] Assume __has_builtin(__builtin_unreachable) Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org We already assume that GCC is at least GCC 5, and we also assume that Clang is at least Clang 4. Clang added support for this builtin in Clang 2.7: llvm.git bf20638966e2 (2009-09-21; "Implement __builtin_unreachable(), a GCC 4.5 extension.") $ git describe --contains bf20638966e2 llvmorg-2.7.0~11211 Signed-off-by: Alejandro Colomar --- soft-fp/soft-fp.h | 4 ---- timezone/private.h | 9 --------- 2 files changed, 13 deletions(-) diff --git a/soft-fp/soft-fp.h b/soft-fp/soft-fp.h index 3b8d7e2265..a949962a63 100644 --- a/soft-fp/soft-fp.h +++ b/soft-fp/soft-fp.h @@ -49,11 +49,7 @@ /* For unreachable default cases in switch statements over bitwise OR of FP_CLS_* values. */ -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) # define _FP_UNREACHABLE __builtin_unreachable () -#else -# define _FP_UNREACHABLE abort () -#endif #if ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)) diff --git a/timezone/private.h b/timezone/private.h index 4f430dba2c..838cfa76f1 100644 --- a/timezone/private.h +++ b/timezone/private.h @@ -904,16 +904,7 @@ time_t timeoff(struct tm *, long); # undef unreachable # define unreachable() abort() #elif !defined unreachable -# ifdef __has_builtin -# if __has_builtin(__builtin_unreachable) -# define unreachable() __builtin_unreachable() -# endif -# elif 4 < __GNUC__ + (5 <= __GNUC_MINOR__) # define unreachable() __builtin_unreachable() -# endif -# ifndef unreachable -# define unreachable() ((void) 0) -# endif #endif /*