From 994fc9abdde826d0b843b48e8ef1627295c3ae25 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 20 Aug 2010 20:49:46 +0200 Subject: re PR middle-end/44974 (Function with attribute noreturn omits a call to another function with noreturn) PR middle-end/44974 * builtins.c (expand_builtin): Don't optimize away calls to DECL_LOOPING_CONST_OR_PURE_P builtins. * gcc.dg/pr44974.c: New test. From-SVN: r163415 --- gcc/builtins.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/builtins.c') diff --git a/gcc/builtins.c b/gcc/builtins.c index 9a79adb..e8974e1 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -5770,7 +5770,8 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, none of its arguments are volatile, we can avoid expanding the built-in call and just evaluate the arguments for side-effects. */ if (target == const0_rtx - && (DECL_PURE_P (fndecl) || TREE_READONLY (fndecl))) + && (DECL_PURE_P (fndecl) || TREE_READONLY (fndecl)) + && !DECL_LOOPING_CONST_OR_PURE_P (fndecl)) { bool volatilep = false; tree arg; -- cgit v1.1