From 61c83496abc38e456ba65e4707f1614d2daddcb6 Mon Sep 17 00:00:00 2001 From: sayle Date: Thu, 30 Mar 2006 22:37:55 +0000 Subject: [PATCH] PR middle-end/22375 * trans.c (gfc_trans_runtime_check): Promote the arguments of __builtin_expect to the correct types, and the result back to boolean_type_node. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112547 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 7 +++++++ gcc/fortran/trans.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 379d687..e1d1d30 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2006-03-30 Roger Sayle + + PR middle-end/22375 + * trans.c (gfc_trans_runtime_check): Promote the arguments of + __builtin_expect to the correct types, and the result back to + boolean_type_node. + 2006-03-29 Carlos O'Donell * Make-lang.in: Rename docdir to gcc_docdir. diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index a586932..3a15d8b 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -340,9 +340,11 @@ gfc_trans_runtime_check (tree cond, tree msg, stmtblock_t * pblock) else { /* Tell the compiler that this isn't likely. */ + cond = fold_convert (long_integer_type_node, cond); tmp = gfc_chainon_list (NULL_TREE, cond); - tmp = gfc_chainon_list (tmp, integer_zero_node); + tmp = gfc_chainon_list (tmp, build_int_cst (long_integer_type_node, 0)); cond = build_function_call_expr (built_in_decls[BUILT_IN_EXPECT], tmp); + cond = fold_convert (boolean_type_node, cond); tmp = build3_v (COND_EXPR, cond, body, build_empty_stmt ()); gfc_add_expr_to_block (pblock, tmp); -- 2.7.4