From d2b48f0c58acd993a34ce2ab25166ef727a12cce Mon Sep 17 00:00:00 2001 From: daney Date: Thu, 11 Jun 2009 23:55:45 +0000 Subject: 2009-06-11 David Daney 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 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 --- gcc/testsuite/gcc.dg/builtin-unreachable-2.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/builtin-unreachable-2.c (limited to 'gcc/testsuite/gcc.dg/builtin-unreachable-2.c') diff --git a/gcc/testsuite/gcc.dg/builtin-unreachable-2.c b/gcc/testsuite/gcc.dg/builtin-unreachable-2.c new file mode 100644 index 00000000000..13bdb9f7395 --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-unreachable-2.c @@ -0,0 +1,20 @@ +/* Check that __builtin_unreachable() is a no-return function thus + causing the dead call to foo() to be removed. The comparison is + dead too, and should be removed. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized -fdump-rtl-cse1" } */ +void foo (void); + +int +f (int i) +{ + if (i > 1) + __builtin_unreachable(); + if (i > 1) + foo (); + return 1; +} +/* { dg-final { scan-tree-dump-not "foo" "optimized" } } */ +/* { dg-final { scan-rtl-dump-not "\\(if_then_else" "cse1" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ +/* { dg-final { cleanup-rtl-dump "cse1" } } */ -- cgit v1.2.1