diff options
author | kugan <kugan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-09-27 03:41:14 +0000 |
---|---|---|
committer | kugan <kugan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-09-27 03:41:14 +0000 |
commit | b09a4365314aaf924ed445aba6202d8f9f97eca6 (patch) | |
tree | f998314ef3804e0b57a614c034f940830e779812 /gcc/ipa-prop.c | |
parent | e796a8b79acfb903a6938db715b0b1f1b8c9102b (diff) | |
download | gcc-b09a4365314aaf924ed445aba6202d8f9f97eca6.tar.gz |
Fix ipa-vrp convert value_range
gcc/ChangeLog:
2016-09-27 Kugan Vivekanandarajah <kuganv@linaro.org>
PR ipa/77677
* ipa-prop.c (ipa_compute_jump_functions_for_edge): Use
extract_range_from_unary_expr to convert value_range.
* tree-vrp.c (extract_range_from_unary_expr_1): Rename to.
(extract_range_from_unary_expr): This.
* tree-vrp.h (extract_range_from_unary_expr): Declare.
gcc/testsuite/ChangeLog:
2016-09-27 Kugan Vivekanandarajah <kuganv@linaro.org>
PR ipa/77677
* gcc.dg/torture/pr77677-2.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@240517 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index feecd232afc..302a47935a1 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -1703,13 +1703,23 @@ ipa_compute_jump_functions_for_edge (struct ipa_func_body_info *fbi, if (TREE_CODE (arg) == SSA_NAME && param_type && (type = get_range_info (arg, &min, &max)) - && (type == VR_RANGE || type == VR_ANTI_RANGE) - && (min.get_precision () <= TYPE_PRECISION (param_type))) + && (type == VR_RANGE || type == VR_ANTI_RANGE)) { - jfunc->vr_known = true; - jfunc->m_vr.type = type; - jfunc->m_vr.min = wide_int_to_tree (param_type, min); - jfunc->m_vr.max = wide_int_to_tree (param_type, max); + value_range vr; + + vr.type = type; + vr.min = wide_int_to_tree (TREE_TYPE (arg), min); + vr.max = wide_int_to_tree (TREE_TYPE (arg), max); + vr.equiv = NULL; + extract_range_from_unary_expr (&jfunc->m_vr, + NOP_EXPR, + param_type, + &vr, TREE_TYPE (arg)); + if (jfunc->m_vr.type == VR_RANGE + || jfunc->m_vr.type == VR_ANTI_RANGE) + jfunc->vr_known = true; + else + jfunc->vr_known = false; } else gcc_assert (!jfunc->vr_known); |