mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-21 08:30:35 +08:00
re PR tree-optimization/51039 (ICE: in estimate_function_body_sizes, at ipa-inline-analysis.c:1977 with -finline-small-functions -fno-ipa-pure-const and passing incompatible function ptr)
2011-11-09 Richard Guenther <rguenther@suse.de> PR tree-optimization/51039 * gimple-low.c (gimple_check_call_args): Remove. (gimple_check_call_matching_types): Always return true. * tree-inline.c (setup_one_parameter): Always perform a valid gimple type change. (declare_return_variable): Likewise. From-SVN: r181204
This commit is contained in:
parent
e3d871e475
commit
c4ac6e9400
@ -1,3 +1,10 @@
|
||||
2011-11-09 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/51039
|
||||
* tree-inline.c (setup_one_parameter): Always perform a
|
||||
valid gimple type change.
|
||||
(declare_return_variable): Likewise.
|
||||
|
||||
2011-11-09 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* config/rs6000/vector.md (vcondv4sfv4si, vcondv4siv4sf,
|
||||
|
@ -2574,14 +2574,21 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
|
||||
&& value != error_mark_node
|
||||
&& !useless_type_conversion_p (TREE_TYPE (p), TREE_TYPE (value)))
|
||||
{
|
||||
/* If we can match up types by promotion/demotion do so. */
|
||||
if (fold_convertible_p (TREE_TYPE (p), value))
|
||||
rhs = fold_build1 (NOP_EXPR, TREE_TYPE (p), value);
|
||||
rhs = fold_convert (TREE_TYPE (p), value);
|
||||
else
|
||||
/* ??? For valid (GIMPLE) programs we should not end up here.
|
||||
Still if something has gone wrong and we end up with truly
|
||||
mismatched types here, fall back to using a VIEW_CONVERT_EXPR
|
||||
to not leak invalid GIMPLE to the following passes. */
|
||||
rhs = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (p), value);
|
||||
{
|
||||
/* ??? For valid programs we should not end up here.
|
||||
Still if we end up with truly mismatched types here, fall back
|
||||
to using a VIEW_CONVERT_EXPR or a literal zero to not leak invalid
|
||||
GIMPLE to the following passes. */
|
||||
if (!is_gimple_reg_type (TREE_TYPE (value))
|
||||
|| TYPE_SIZE (TREE_TYPE (p)) == TYPE_SIZE (TREE_TYPE (value)))
|
||||
rhs = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (p), value);
|
||||
else
|
||||
rhs = build_zero_cst (TREE_TYPE (p));
|
||||
}
|
||||
}
|
||||
|
||||
/* Make an equivalent VAR_DECL. Note that we must NOT remap the type
|
||||
@ -2912,7 +2919,27 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
|
||||
promoted, convert it back to the expected type. */
|
||||
use = var;
|
||||
if (!useless_type_conversion_p (caller_type, TREE_TYPE (var)))
|
||||
use = fold_convert (caller_type, var);
|
||||
{
|
||||
/* If we can match up types by promotion/demotion do so. */
|
||||
if (fold_convertible_p (caller_type, var))
|
||||
use = fold_convert (caller_type, var);
|
||||
else
|
||||
{
|
||||
/* ??? For valid programs we should not end up here.
|
||||
Still if we end up with truly mismatched types here, fall back
|
||||
to using a MEM_REF to not leak invalid GIMPLE to the following
|
||||
passes. */
|
||||
/* Prevent var from being written into SSA form. */
|
||||
if (TREE_CODE (TREE_TYPE (var)) == VECTOR_TYPE
|
||||
|| TREE_CODE (TREE_TYPE (var)) == COMPLEX_TYPE)
|
||||
DECL_GIMPLE_REG_P (var) = false;
|
||||
else if (is_gimple_reg_type (TREE_TYPE (var)))
|
||||
TREE_ADDRESSABLE (var) = true;
|
||||
use = fold_build2 (MEM_REF, caller_type,
|
||||
build_fold_addr_expr (var),
|
||||
build_int_cst (ptr_type_node, 0));
|
||||
}
|
||||
}
|
||||
|
||||
STRIP_USELESS_TYPE_CONVERSION (use);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user