]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-inline: Simplify IPA-CP type conversion (PR 93385)
authorMartin Jambor <mjambor@suse.cz>
Mon, 4 May 2020 11:53:54 +0000 (13:53 +0200)
committerMartin Jambor <mjambor@suse.cz>
Mon, 4 May 2020 11:53:54 +0000 (13:53 +0200)
commit375a77925c320a273d3b1ef3182f29f31aaa8edf
tree1c2973771045109699c92bea00436b7492f9f33e
parent8ea03e9016cbca5a7ee2b4befa4d5c32467b0982
tree-inline: Simplify IPA-CP type conversion (PR 93385)

when callers and callees do not quite agree on the type of a
parameter, usually with ill-defined K&R or with smilarly wrong LTO
input, IPA-CP can attempt to try and substitute a wrong type for a
parameter (see e.g. gcc.dg/torture/pr48063.c).  Function
tree_function_versioning attempts to handle this in order not to
create invalid gimple but it then creates the mapping using
setup_one_parameter which also handles the same situation to avoid
similar problems when inlining and in more defined way.

So this patch simply removes the conversion attempts in
tree_function_versioning itself.  It is helpful for my upcoming fix of
PR 93385 because then I do not need to teach
ipa_param_body_adjustments to distinguish between successful and
unsuccessful mappings - setup_one_parameter uses force_value_to_type
for conversions which simly maps the worst cases to zero.

2020-05-04  Martin Jambor  <mjambor@suse.cz>

PR ipa/93385
* tree-inline.c (tree_function_versioning): Leave any type conversion
of replacements to setup_one_parameter and its friend
force_value_to_type.
gcc/ChangeLog
gcc/tree-inline.c