else
vdef = make_ssa_name (gimple_vop (cfun), new_stmt);
gimple_set_vdef (new_stmt, vdef);
- if (TREE_CODE (vdef) == SSA_NAME)
+ if (vdef && TREE_CODE (vdef) == SSA_NAME)
SSA_NAME_DEF_STMT (vdef) = new_stmt;
laststore = new_stmt;
}
case BUILT_IN_MEMMOVE_CHK:
case BUILT_IN_MEMSET_CHK:
case BUILT_IN_STRNCPY_CHK:
+ case BUILT_IN_STPNCPY_CHK:
arg_idx = 2;
type = 2;
break;
break;
case BUILT_IN_STRNCPY_CHK:
+ case BUILT_IN_STPNCPY_CHK:
if (val[2] && is_gimple_val (val[2]) && nargs == 4)
- result = fold_builtin_strncpy_chk (loc, gimple_call_arg (stmt, 0),
+ result = fold_builtin_stxncpy_chk (loc, gimple_call_arg (stmt, 0),
gimple_call_arg (stmt, 1),
gimple_call_arg (stmt, 2),
gimple_call_arg (stmt, 3),
- val[2]);
+ val[2], ignore,
+ DECL_FUNCTION_CODE (callee));
break;
case BUILT_IN_SNPRINTF_CHK:
}
}
- /* Check whether propagating into the function address made the
- call direct, and thus possibly non-inlineable.
- ??? This asks for a more conservative setting of the non-inlinable
- flag, namely true for all indirect calls. But that would require
- that we can re-compute the flag conservatively, thus it isn't
- ever initialized from something else than return/argument type
- checks . */
- callee = gimple_call_fndecl (stmt);
- if (callee
- && !gimple_check_call_matching_types (stmt, callee))
- gimple_call_set_cannot_inline (stmt, true);
-
if (inplace)
return changed;
/* Check for builtins that CCP can handle using information not
available in the generic fold routines. */
+ callee = gimple_call_fndecl (stmt);
if (callee && DECL_BUILT_IN (callee))
{
tree result = gimple_fold_builtin (stmt);
if (CONVERT_EXPR_CODE_P (subcode)
&& POINTER_TYPE_P (TREE_TYPE (lhs))
&& POINTER_TYPE_P (TREE_TYPE (op0))
- && (TYPE_ADDR_SPACE (TREE_TYPE (lhs))
- == TYPE_ADDR_SPACE (TREE_TYPE (op0))))
+ && TYPE_ADDR_SPACE (TREE_TYPE (lhs))
+ == TYPE_ADDR_SPACE (TREE_TYPE (op0))
+ && TYPE_MODE (TREE_TYPE (lhs))
+ == TYPE_MODE (TREE_TYPE (op0)))
return op0;
return