]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Use CASE_CONVERT in a few more cases
authorRichard Biener <rguenther@suse.de>
Wed, 12 Jan 2022 09:42:32 +0000 (10:42 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 2 May 2022 06:06:04 +0000 (08:06 +0200)
This uses CASE_CONVERT more which eases eventual removal of NOP_EXPR.

2022-04-29  Richard Biener  <rguenther@suse.de>

gcc/cp/
* constexpr.cc (fold_simple_1): Use CASE_CONVERT.
* cp-gimplify.cc (cp_fold): Likewise.
* pt.cc (tsubst_copy): Likewise.

gcc/
* dojump.cc (do_jump): Use CASE_CONVERT.
* tree-ssa-dom.cc (edge_info::derive_equivalences): Likewise.

gcc/cp/constexpr.cc
gcc/cp/cp-gimplify.cc
gcc/cp/pt.cc
gcc/dojump.cc
gcc/tree-ssa-dom.cc

index 47d5113ace26791031dd55619c546589bc75bb4d..c40efa6cc4ebf767310e527d64d968403ecc42f0 100644 (file)
@@ -8016,9 +8016,8 @@ fold_simple_1 (tree t)
     case NEGATE_EXPR:
     case BIT_NOT_EXPR:
     case TRUTH_NOT_EXPR:
-    case NOP_EXPR:
     case VIEW_CONVERT_EXPR:
-    case CONVERT_EXPR:
+    CASE_CONVERT:
     case FLOAT_EXPR:
     case FIX_TRUNC_EXPR:
     case FIXED_CONVERT_EXPR:
index e4c2644af15b67ae69f3863bc70b346650c2f2cd..b52d9cb575472b184dac9d07f49ee9a9bb6f32b9 100644 (file)
@@ -2451,9 +2451,8 @@ cp_fold (tree x)
     case VIEW_CONVERT_EXPR:
       rval_ops = false;
       /* FALLTHRU */
-    case CONVERT_EXPR:
-    case NOP_EXPR:
     case NON_LVALUE_EXPR:
+    CASE_CONVERT:
 
       if (VOID_TYPE_P (TREE_TYPE (x)))
        {
index 81c3c598c71e04382b05adfc5bd790f44e75542e..e6006540e7aad353c0b5e673b297bf4a9524d5fc 100644 (file)
@@ -17152,8 +17152,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
     case STATIC_CAST_EXPR:
     case DYNAMIC_CAST_EXPR:
     case IMPLICIT_CONV_EXPR:
-    case CONVERT_EXPR:
-    case NOP_EXPR:
+    CASE_CONVERT:
       {
        tsubst_flags_t tcomplain = complain;
        if (code == CAST_EXPR)
index 0c880d653389b97596c68fde72aa3c76273687e2..17a73da744895208bd17ca536c3a445c357e5dfb 100644 (file)
@@ -421,14 +421,12 @@ do_jump (tree exp, rtx_code_label *if_false_label,
       break;
 #endif
 
-    case NOP_EXPR:
+    CASE_CONVERT:
       if (TREE_CODE (TREE_OPERAND (exp, 0)) == COMPONENT_REF
           || TREE_CODE (TREE_OPERAND (exp, 0)) == BIT_FIELD_REF
           || TREE_CODE (TREE_OPERAND (exp, 0)) == ARRAY_REF
           || TREE_CODE (TREE_OPERAND (exp, 0)) == ARRAY_RANGE_REF)
         goto normal;
-      /* FALLTHRU */
-    case CONVERT_EXPR:
       /* If we are narrowing the operand, we have to do the compare in the
          narrower mode.  */
       if ((TYPE_PRECISION (TREE_TYPE (exp))
index 4a0cf2ef54c8f5b855237feb821b1802c72e4041..89b05171d57c6a15647dee4aade44c8c80b9a705 100644 (file)
@@ -220,8 +220,7 @@ edge_info::derive_equivalences (tree name, tree value, int recursion_limit)
        /* If LHS is an SSA_NAME and RHS is a constant integer and LHS was
           set via a widening type conversion, then we may be able to record
           additional equivalences.  */
-       case NOP_EXPR:
-       case CONVERT_EXPR:
+       CASE_CONVERT:
          {
            tree rhs = gimple_assign_rhs1 (def_stmt);
            tree rhs_type = TREE_TYPE (rhs);