Add missing gimple_call_set_fntype
authorMartin Jambor <mjambor@suse.cz>
Fri, 4 Oct 2019 16:25:02 +0000 (18:25 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 4 Oct 2019 16:25:02 +0000 (18:25 +0200)
2019-10-04  Martin Jambor  <mjambor@suse.cz>

* tree-ssa-forwprop.c (simplify_builtin_call): Set gimple call
fntype when switching to calling memcpy instead of memset.

From-SVN: r276593

gcc/ChangeLog
gcc/tree-ssa-forwprop.c

index 5883b18acd7ee66056e0e6f20d4ecfc545281432..a013d86da07c8a9f09dd4624b3dad3bb4432ace2 100644 (file)
@@ -1,3 +1,8 @@
+2019-10-04  Martin Jambor  <mjambor@suse.cz>
+
+       * tree-ssa-forwprop.c (simplify_builtin_call): Set gimple call
+       fntype when switching to calling memcpy instead of memset.
+
 2019-10-04  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
        * hash-table.h (hash_table::empty_slow): Don't assign
index 221f140b356fc9792525882ec1e27d04fe240edf..a1e22c936314d52fe3cac09564f89ce1595f5e98 100644 (file)
@@ -1426,8 +1426,10 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
              if (!is_gimple_val (ptr1))
                ptr1 = force_gimple_operand_gsi (gsi_p, ptr1, true, NULL_TREE,
                                                 true, GSI_SAME_STMT);
-             gimple_call_set_fndecl (stmt2,
-                                     builtin_decl_explicit (BUILT_IN_MEMCPY));
+             tree fndecl = builtin_decl_explicit (BUILT_IN_MEMCPY);
+             gimple_call_set_fndecl (stmt2, fndecl);
+             gimple_call_set_fntype (as_a <gcall *> (stmt2),
+                                     TREE_TYPE (fndecl));
              gimple_call_set_arg (stmt2, 0, ptr1);
              gimple_call_set_arg (stmt2, 1, new_str_cst);
              gimple_call_set_arg (stmt2, 2,