From owner-svn-src-head@FreeBSD.ORG Thu May 14 15:49:49 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A439A24; Thu, 14 May 2015 15:49:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 456321C68; Thu, 14 May 2015 15:49:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4EFnnAw094251; Thu, 14 May 2015 15:49:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4EFnnQg094250; Thu, 14 May 2015 15:49:49 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201505141549.t4EFnnQg094250@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 14 May 2015 15:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282907 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2015 15:49:49 -0000 Author: pfg Date: Thu May 14 15:49:48 2015 New Revision: 282907 URL: https://svnweb.freebsd.org/changeset/base/282907 Log: Add new __unreachable() builtin This is one of the few post gcc4.2 builtins that has been implemented by clang: __builtin_unreachable is used to indicate that a specific point in the program cannot be reached, even if the compiler might otherwise think it can. This is useful to improve optimization and eliminates certain warnings. Hinted by: NetBSD Differential Revision: https://reviews.freebsd.org/D2536 Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Thu May 14 15:14:03 2015 (r282906) +++ head/sys/sys/cdefs.h Thu May 14 15:49:48 2015 (r282907) @@ -388,6 +388,12 @@ #define __alloc_size(x) #endif +#if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6) +#define __unreachable() __builtin_unreachable() +#else +#define __unreachable() do {} while (/*CONSTCOND*/0) +#endif + #if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9) #define __alloc_align(x) __attribute__((__alloc_align__(x))) #else