]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
d: Remove dead code from binary_op.
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 27 Jul 2021 11:27:33 +0000 (13:27 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Fri, 30 Jul 2021 10:54:05 +0000 (12:54 +0200)
The front-end ensures that both sides have been casted to the same type
before being given to the lowering pass.

gcc/d/ChangeLog:

* expr.cc (binary_op): Remove dead code.

gcc/d/expr.cc

index 73e0abeaa43fddae3f9d9a7fa7e603cf3648cf0a..e293cf2a4cd2528183c31cfd2c3c4daa0524bc5f 100644 (file)
@@ -101,8 +101,6 @@ binary_op (tree_code code, tree type, tree arg0, tree arg1)
   tree t1 = TREE_TYPE (arg1);
   tree ret = NULL_TREE;
 
-  bool unsignedp = TYPE_UNSIGNED (t0) || TYPE_UNSIGNED (t1);
-
   /* Deal with float mod expressions immediately.  */
   if (code == FLOAT_MOD_EXPR)
     return build_float_modulus (type, arg0, arg1);
@@ -130,12 +128,6 @@ binary_op (tree_code code, tree type, tree arg0, tree arg1)
       else
        ret = fold_build2 (POINTER_DIFF_EXPR, ptrtype, arg0, arg1);
     }
-  else if (INTEGRAL_TYPE_P (type) && (TYPE_UNSIGNED (type) != unsignedp))
-    {
-      tree inttype = (unsignedp)
-       ? d_unsigned_type (type) : d_signed_type (type);
-      ret = fold_build2 (code, inttype, arg0, arg1);
-    }
   else
     {
       /* If the operation needs excess precision.  */