]> gcc.gnu.org Git - gcc.git/commitdiff
re PR middle-end/22375 (fold_builtins creates mis-matched types)
authorRoger Sayle <roger@eyesopen.com>
Thu, 30 Mar 2006 22:37:55 +0000 (22:37 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Thu, 30 Mar 2006 22:37:55 +0000 (22:37 +0000)
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.

From-SVN: r112547

gcc/fortran/ChangeLog
gcc/fortran/trans.c

index 379d687aea34b7f633ca208b24efc3fff8fd95e6..e1d1d30ff9f9ee1c8e82cd036a7ff75eebd62805 100644 (file)
@@ -1,3 +1,10 @@
+2006-03-30  Roger Sayle  <roger@eyesopen.com>
+
+       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  <carlos@codesourcery.com>
 
        * Make-lang.in: Rename docdir to gcc_docdir.
index a586932c9d6932b7df8737f6cd9bbf4f1c129f7d..3a15d8b69d9370cb9a4d60418c301efa2bd29064 100644 (file)
@@ -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);
This page took 0.064049 seconds and 5 git commands to generate.