aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bily <tbily@suse.cz>2008-06-02 11:45:27 +0200
committerTomas Bily <tomby@gcc.gnu.org>2008-06-02 11:45:27 +0200
commit5f9e56b3f27c9b2e9437b1b819b61b2c04669eaa (patch)
tree690f161df4fa6eb3bb0b0da87e874d149fcdc71d
parente47551edc649320ac15a155ca089b743f1543fab (diff)
downloadgcc-5f9e56b3f27c9b2e9437b1b819b61b2c04669eaa.zip
gcc-5f9e56b3f27c9b2e9437b1b819b61b2c04669eaa.tar.gz
gcc-5f9e56b3f27c9b2e9437b1b819b61b2c04669eaa.tar.bz2
tree-ssa-ifcombine.c (get_name_for_bit_test): Use CONVERT_EXPR_P.
* tree-ssa-ifcombine.c (get_name_for_bit_test): Use CONVERT_EXPR_P. * cp/typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT. (cp_build_unary_op): Likewise. (cp_build_indirect_ref): Use CONVERT_EXPR_P. (maybe_warn_about_returning_address_of_local): Likewise. From-SVN: r136273
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/typeck.c14
-rw-r--r--gcc/tree-ssa-ifcombine.c3
4 files changed, 17 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cd13a87..e3888fd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-02 Tomas Bily <tbily@suse.cz>
+
+ * tree-ssa-ifcombine.c (get_name_for_bit_test): Use CONVERT_EXPR_P.
+
2008-06-01 Richard Sandiford <rdsandiford@googlemail.com>
* config/mips/mips.c (mips_valid_offset_p): New function.
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f9b1971..6fe0199 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-02 Tomas Bily <tbily@suse.cz>
+
+ * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
+ (cp_build_unary_op): Likewise.
+ (cp_build_indirect_ref): Use CONVERT_EXPR_P.
+ (maybe_warn_about_returning_address_of_local): Likewise.
+
2008-05-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/35243
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index bf264ad..026e446 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1515,8 +1515,7 @@ is_bitfield_expr_with_lowered_type (const_tree exp)
return DECL_BIT_FIELD_TYPE (field);
}
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (exp, 0)))
== TYPE_MAIN_VARIANT (TREE_TYPE (exp)))
return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 0));
@@ -2449,8 +2448,7 @@ cp_build_indirect_ref (tree ptr, const char *errorstring,
types. */
tree t = canonical_type_variant (TREE_TYPE (type));
- if (TREE_CODE (ptr) == CONVERT_EXPR
- || TREE_CODE (ptr) == NOP_EXPR
+ if (CONVERT_EXPR_P (ptr)
|| TREE_CODE (ptr) == VIEW_CONVERT_EXPR)
{
/* If a warning is issued, mark it to avoid duplicates from
@@ -4658,8 +4656,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
switch (TREE_CODE (arg))
{
- case NOP_EXPR:
- case CONVERT_EXPR:
+ CASE_CONVERT:
case FLOAT_EXPR:
case FIX_TRUNC_EXPR:
/* Even if we're not being pedantic, we cannot allow this
@@ -6854,9 +6851,8 @@ maybe_warn_about_returning_address_of_local (tree retval)
{
if (TREE_CODE (whats_returned) == COMPOUND_EXPR)
whats_returned = TREE_OPERAND (whats_returned, 1);
- else if (TREE_CODE (whats_returned) == CONVERT_EXPR
- || TREE_CODE (whats_returned) == NON_LVALUE_EXPR
- || TREE_CODE (whats_returned) == NOP_EXPR)
+ else if (CONVERT_EXPR_P (whats_returned)
+ || TREE_CODE (whats_returned) == NON_LVALUE_EXPR)
whats_returned = TREE_OPERAND (whats_returned, 0);
else
break;
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index 4dbe750..93e7810 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -148,8 +148,7 @@ get_name_for_bit_test (tree candidate)
{
tree def_stmt = SSA_NAME_DEF_STMT (candidate);
if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
- && (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == NOP_EXPR
- || TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == CONVERT_EXPR))
+ && CONVERT_EXPR_P (GIMPLE_STMT_OPERAND (def_stmt, 1)))
{
tree rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
if (TYPE_PRECISION (TREE_TYPE (rhs))