diff options
author | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-06 13:10:31 +0000 |
---|---|---|
committer | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-06 13:10:31 +0000 |
commit | 5ebccf71ef30bc85daa0b856531eac96a9e0e4cb (patch) | |
tree | 14338b4c19e81b2d5f62b0e78a9d232cce2e975b /gcc/c-family | |
parent | d1bba7d4c292e2b8c2e265bbb9f7648bb025480a (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-gimplify.c | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index ca3e0b36bab..1cb8968c38f 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2014-12-06 Marek Polacek <polacek@redhat.com> + + 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. + 2014-11-29 Jakub Jelinek <jakub@redhat.com> * c-common.c (convert_vector_to_pointer_for_subscript): Remove NULL 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; } |