aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>2015-11-19 17:30:24 +0000
committerJeff Law <law@gcc.gnu.org>2015-11-19 10:30:24 -0700
commit1014b6f54b75b690b81dfac4b284961c2fb51646 (patch)
treec46d7a664854f1eb101011a8c8f91af5e052887e /gcc/tree-vrp.c
parent04a9bb6ec35a925ec15fcaafe16124748c3bfcc9 (diff)
downloadgcc-1014b6f54b75b690b81dfac4b284961c2fb51646.zip
gcc-1014b6f54b75b690b81dfac4b284961c2fb51646.tar.gz
gcc-1014b6f54b75b690b81dfac4b284961c2fb51646.tar.bz2
[Patch, vrp] Allow VRP type conversion folding only for widenings upto word mode
* tree.h (desired_pro_or_demotion_p): New function. * tree-vrp.c (simplify_cond_using_ranges): Call it. * gcc.dg/tree-ssa/vrp98.c: New testcase. * gcc.target/avr/uint8-single-reg.c: New testcase. From-SVN: r230618
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 736082b..f2c948c 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -9459,7 +9459,8 @@ simplify_cond_using_ranges (gcond *stmt)
innerop = gimple_assign_rhs1 (def_stmt);
if (TREE_CODE (innerop) == SSA_NAME
- && !POINTER_TYPE_P (TREE_TYPE (innerop)))
+ && !POINTER_TYPE_P (TREE_TYPE (innerop))
+ && desired_pro_or_demotion_p (TREE_TYPE (innerop), TREE_TYPE (op0)))
{
value_range *vr = get_value_range (innerop);