summaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authordaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-11 23:55:45 +0000
committerdaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-11 23:55:45 +0000
commitd2b48f0c58acd993a34ce2ab25166ef727a12cce (patch)
tree33e26cb48c7e5455995d1edba975d67cf78cad99 /gcc/system.h
parentf6e79f69bcfd79a673dc4ab19db9af5513c87dbb (diff)
downloadgcc-d2b48f0c58acd993a34ce2ab25166ef727a12cce.tar.gz
2009-06-11 David Daney <ddaney@caviumnetworks.com>
PR c/39252 * doc/extend.texi ( __builtin_unreachable): Document new builtin. * builtins.c (expand_builtin_unreachable): New function. (expand_builtin): Handle BUILT_IN_UNREACHABLE case. * builtins.def (BUILT_IN_UNREACHABLE): Add new builtin. * cfgcleanup.c (try_optimize_cfg): Delete empty blocks with no successors. * cfgrtl.c (rtl_verify_flow_info): Handle empty blocks when searching for missing barriers. 2009-06-11 David Daney <ddaney@caviumnetworks.com> PR c/39252 * gcc.dg/builtin-unreachable-1.c: New test. * gcc.dg/builtin-unreachable-2.c: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148403 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/system.h')
-rw-r--r--gcc/system.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/system.h b/gcc/system.h
index 51d9c995c3c..3bb61ce8490 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -576,14 +576,20 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
#if ENABLE_ASSERT_CHECKING
#define gcc_assert(EXPR) \
((void)(!(EXPR) ? fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0 : 0))
+#elif (__GNUC__ == 4) && (__GNUC_MINOR__) && 0
+#define gcc_assert(EXPR) do { if (EXPR) __builtin_unreachable (); } while (0)
#else
/* Include EXPR, so that unused variable warnings do not occur. */
#define gcc_assert(EXPR) ((void)(0 && (EXPR)))
#endif
+#if !ENABLE_ASSERT_CHECKING && (__GNUC__ == 4) && (__GNUC_MINOR__) && 0
+#define gcc_unreachable() __builtin_unreachable ()
+#else
/* Use gcc_unreachable() to mark unreachable locations (like an
unreachable default case of a switch. Do not use gcc_assert(0). */
#define gcc_unreachable() (fancy_abort (__FILE__, __LINE__, __FUNCTION__))
+#endif
/* Provide a fake boolean type. We make no attempt to use the
C99 _Bool, as it may not be available in the bootstrap compiler,