public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-65] Use CASE_CONVERT in a few more cases
@ 2022-05-02  6:06 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-05-02  6:06 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:82a344f206725ba002af4fed318f37dfb7e566a0

commit r13-65-g82a344f206725ba002af4fed318f37dfb7e566a0
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Jan 12 10:42:32 2022 +0100

    Use CASE_CONVERT in a few more cases
    
    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.

Diff:
---
 gcc/cp/constexpr.cc   | 3 +--
 gcc/cp/cp-gimplify.cc | 3 +--
 gcc/cp/pt.cc          | 3 +--
 gcc/dojump.cc         | 4 +---
 gcc/tree-ssa-dom.cc   | 3 +--
 5 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/gcc/cp/constexpr.cc b/gcc/cp/constexpr.cc
index 47d5113ace2..c40efa6cc4e 100644
--- a/gcc/cp/constexpr.cc
+++ b/gcc/cp/constexpr.cc
@@ -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:
diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc
index e4c2644af15..b52d9cb5754 100644
--- a/gcc/cp/cp-gimplify.cc
+++ b/gcc/cp/cp-gimplify.cc
@@ -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)))
 	{
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 81c3c598c71..e6006540e7a 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -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)
diff --git a/gcc/dojump.cc b/gcc/dojump.cc
index 0c880d65338..17a73da7448 100644
--- a/gcc/dojump.cc
+++ b/gcc/dojump.cc
@@ -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))
diff --git a/gcc/tree-ssa-dom.cc b/gcc/tree-ssa-dom.cc
index 4a0cf2ef54c..89b05171d57 100644
--- a/gcc/tree-ssa-dom.cc
+++ b/gcc/tree-ssa-dom.cc
@@ -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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-02  6:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02  6:06 [gcc r13-65] Use CASE_CONVERT in a few more cases Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).