https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102705

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Hmm:
  iftmp.0_10 = (char) _2;
  _4 = iftmp.0_10 ^ 1;
  _18 = (int) _4;


We have this pattern:
 /* In GIMPLE, getting rid of 2 conversions for one new results
    in smaller IL.  */
 (simplify
  (convert (bitop:cs@2 (nop_convert:s @0) @1))
  (if (GIMPLE
       && TREE_CODE (@1) != INTEGER_CST
       && tree_nop_conversion_p (type, TREE_TYPE (@2))
       && types_match (type, @0)
       && !POINTER_TYPE_P (TREE_TYPE (@0))
       && TREE_CODE (TREE_TYPE (@0)) != OFFSET_TYPE)
   (bitop @0 (convert @1)))))


Except here @1 is CST and the we don't exactly have a nop_conversion, though it
is a "nop" due to the nonzero-bitranges to be less than the inner type.

Maybe we could expand or create a new pattern for this ...

Reply via email to