[PR 82808] Use proper result types for arithmetic jump functions
commit944ee40d1902385754eb10090eb10e154a22959f
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 Nov 2017 18:52:49 +0000 (28 18:52 +0000)
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 28 Nov 2017 18:52:49 +0000 (28 18:52 +0000)
tree388b7b37472dc993932261974e447d795dcdf3c9
parent891c5e19402dd883a369b92a9d3e6cf3ed1ebdf8
[PR 82808] Use proper result types for arithmetic jump functions

2017-11-28  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
    Martin Jambor  <mjambor@suse.cz>

PR ipa/82808
* tree.h (expr_type_first_operand_type_p): Declare
* tree.c (expr_type_first_operand_type_p): New function.
* ipa-prop.h (ipa_get_type): Allow i to be out of bounds.
(ipa_value_from_jfunc): Adjust declaration.
* ipa-cp.c (ipa_get_jf_pass_through_result): New parameter RES_TYPE.
Use it as result type for arithmetics, unless it is NULL in which case
be more conservative.
(ipa_value_from_jfunc): New parameter PARM_TYPE, pass it to
ipa_get_jf_pass_through_result.
(propagate_vals_across_pass_through): Likewise.
(propagate_scalar_across_jump_function): New parameter PARM_TYPE, pass
is to propagate_vals_across_pass_through.
(propagate_constants_across_call): Pass PARM_TYPE to
propagate_scalar_across_jump_function.
(find_more_scalar_values_for_callers_subset): Pass parameter type to
ipa_value_from_jfunc.
(cgraph_edge_brings_all_scalars_for_node): Likewise.
* ipa-fnsummary.c (evaluate_properties_for_edge): Renamed parms_info
to caller_parms_info, pass parameter type to ipa_value_from_jfunc.
* ipa-prop.c (try_make_edge_direct_simple_call): New parameter
target_type, pass it to ipa_value_from_jfunc.
(update_indirect_edges_after_inlining): Pass parameter type to
try_make_edge_direct_simple_call.

testsuite/
* gcc.dg/ipa/pr82808.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255212 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/ipa-cp.c
gcc/ipa-fnsummary.c
gcc/ipa-prop.c
gcc/ipa-prop.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/ipa/pr82808.c [new file with mode: 0644]
gcc/tree.c
gcc/tree.h