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.
This commit is contained in:
Richard Biener 2022-01-12 10:42:32 +01:00
parent 4a0e89b10f
commit 82a344f206
5 changed files with 5 additions and 11 deletions

View 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:

View 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)))
{

View 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)

View 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))

View 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);