]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/match.pd
match.pd: Further complex simplification fixes [PR104675]
[gcc.git] / gcc / match.pd
index 0bd0ac887e6d82a6c29b749c8654142b843780ef..97399e580a4c6e88761b824695f276fda0ac717e 100644 (file)
@@ -731,7 +731,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 /* Simplify (unsigned t * 2)/2 -> unsigned t & 0x7FFFFFFF.  */
 (simplify
  (trunc_div (mult @0 integer_pow2p@1) @1)
- (if (TYPE_UNSIGNED (TREE_TYPE (@0)))
+ (if (INTEGRAL_TYPE_P (TREE_TYPE (@0)) && TYPE_UNSIGNED (TREE_TYPE (@0)))
   (bit_and @0 { wide_int_to_tree
                (type, wi::mask (TYPE_PRECISION (type)
                                 - wi::exact_log2 (wi::to_wide (@1)),
@@ -740,7 +740,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 /* Simplify (unsigned t / 2) * 2 -> unsigned t & ~1.  */
 (simplify
  (mult (trunc_div @0 integer_pow2p@1) @1)
- (if (TYPE_UNSIGNED (TREE_TYPE (@0)))
+ (if (INTEGRAL_TYPE_P (TREE_TYPE (@0)) && TYPE_UNSIGNED (TREE_TYPE (@0)))
   (bit_and @0 (negate @1))))
 
 /* Simplify (t * 2) / 2) -> t.  */
This page took 0.034909 seconds and 5 git commands to generate.