]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/ipa-prop.cc
[PR 82808] Use proper result types for arithmetic jump functions
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Tue, 28 Nov 2017 18:52:49 +0000 (18:52 +0000)
committerMartin Jambor <jamborm@gcc.gnu.org>
Tue, 28 Nov 2017 18:52:49 +0000 (19:52 +0100)
commite5cf5e116da6f5c018ecc8f714935877c4636780
tree388b7b37472dc993932261974e447d795dcdf3c9
parent5e4a80e8a80584741b1e5dd73b936b15862e9171
[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.

Co-Authored-By: Martin Jambor <mjambor@suse.cz>
From-SVN: r255212
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