Commit 2ad3adf1 by Jakub Jelinek

re PR middle-end/69156 (gcc.dg/pr59630.c: ICE: verify_gimple failed: non-trivial…

re PR middle-end/69156 (gcc.dg/pr59630.c: ICE: verify_gimple failed: non-trivial conversion at assignment with -fno-tree-ccp)

	PR tree-optimization/69156
	* gimple.c (validate_type): Removed.
	(gimple_builtin_call_types_compatible_p): Use
	useless_type_conversion_p instead of validate_type.
	* value-prof.c (gimple_stringop_fixed_value): Fold
	icall_size to correct type.

	* gcc.dg/pr69156.c: New test.

From-SVN: r232342
parent 260936f2
2016-01-13 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/69156
* gimple.c (validate_type): Removed.
(gimple_builtin_call_types_compatible_p): Use
useless_type_conversion_p instead of validate_type.
* value-prof.c (gimple_stringop_fixed_value): Fold
icall_size to correct type.
2016-01-13 Jonathan Wakely <jwakely@redhat.com>
* doc/extend.texi (__atomic Builtins): Clarify compare_exchange
......
......@@ -2445,24 +2445,6 @@ gimple_ior_addresses_taken (bitmap addresses_taken, gimple *stmt)
}
/* Return true if TYPE1 and TYPE2 are compatible enough for builtin
processing. */
static bool
validate_type (tree type1, tree type2)
{
if (INTEGRAL_TYPE_P (type1)
&& INTEGRAL_TYPE_P (type2))
;
else if (POINTER_TYPE_P (type1)
&& POINTER_TYPE_P (type2))
;
else if (TREE_CODE (type1)
!= TREE_CODE (type2))
return false;
return true;
}
/* Return true when STMTs arguments and return value match those of FNDECL,
a decl of a builtin function. */
......@@ -2473,7 +2455,8 @@ gimple_builtin_call_types_compatible_p (const gimple *stmt, tree fndecl)
tree ret = gimple_call_lhs (stmt);
if (ret
&& !validate_type (TREE_TYPE (ret), TREE_TYPE (TREE_TYPE (fndecl))))
&& !useless_type_conversion_p (TREE_TYPE (ret),
TREE_TYPE (TREE_TYPE (fndecl))))
return false;
tree targs = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
......@@ -2484,7 +2467,7 @@ gimple_builtin_call_types_compatible_p (const gimple *stmt, tree fndecl)
if (!targs)
return true;
tree arg = gimple_call_arg (stmt, i);
if (!validate_type (TREE_TYPE (arg), TREE_VALUE (targs)))
if (!useless_type_conversion_p (TREE_VALUE (targs), TREE_TYPE (arg)))
return false;
targs = TREE_CHAIN (targs);
}
......
2016-01-13 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/69156
* gcc.dg/pr69156.c: New test.
2016-01-13 H.J. Lu <hongjiu.lu@intel.com>
* gcc.target/i386/pr69225-7.c: New test.
......
/* PR tree-optimization/69156 */
/* { dg-do compile } */
/* { dg-options "-O1 -fno-tree-ccp" } */
_Bool
foo ()
{
_Bool (*f) () = __builtin_abs; /* { dg-warning "initialization from incompatible pointer type" } */
return f (0);
}
......@@ -1697,7 +1697,8 @@ gimple_stringop_fixed_value (gcall *vcall_stmt, tree icall_size, int prob,
gimple_set_vuse (vcall_stmt, NULL);
update_stmt (vcall_stmt);
icall_stmt = as_a <gcall *> (gimple_copy (vcall_stmt));
gimple_call_set_arg (icall_stmt, size_arg, icall_size);
gimple_call_set_arg (icall_stmt, size_arg,
fold_convert (optype, icall_size));
gsi_insert_before (&gsi, icall_stmt, GSI_SAME_STMT);
/* Fix CFG. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment