summaryrefslogtreecommitdiff
path: root/gcc/c-family/c-gimplify.c
diff options
context:
space:
mode:
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-06 13:10:31 +0000
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-06 13:10:31 +0000
commit5ebccf71ef30bc85daa0b856531eac96a9e0e4cb (patch)
tree14338b4c19e81b2d5f62b0e78a9d232cce2e975b /gcc/c-family/c-gimplify.c
parentd1bba7d4c292e2b8c2e265bbb9f7648bb025480a (diff)
downloadgcc-5ebccf71ef30bc85daa0b856531eac96a9e0e4cb.tar.gz
PR tree-optimization/64183
* c-gimplify.c (c_gimplify_expr): Don't convert the RHS of a shift-expression if it is integer_type_node. Use types_compatible_p. * gcc.dg/tree-ssa/pr64183.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218447 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/c-gimplify.c')
-rw-r--r--gcc/c-family/c-gimplify.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c
index 2cfa5d96a65..4781cf24c64 100644
--- a/gcc/c-family/c-gimplify.c
+++ b/gcc/c-family/c-gimplify.c
@@ -255,7 +255,10 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
type demotion/promotion pass. */
tree *op1_p = &TREE_OPERAND (*expr_p, 1);
if (TREE_CODE (TREE_TYPE (*op1_p)) != VECTOR_TYPE
- && TYPE_MAIN_VARIANT (TREE_TYPE (*op1_p)) != unsigned_type_node)
+ && !types_compatible_p (TYPE_MAIN_VARIANT (TREE_TYPE (*op1_p)),
+ unsigned_type_node)
+ && !types_compatible_p (TYPE_MAIN_VARIANT (TREE_TYPE (*op1_p)),
+ integer_type_node))
*op1_p = convert (unsigned_type_node, *op1_p);
break;
}