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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|target                      |tree-optimization
   Last reconfirmed|                            |2020-07-22
     Ever confirmed|0                           |1

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note this could be folded on the GIMPLE level already similar to how we
inline string comparisons of size 1.  We should already fold this to
MEMCMP_EQ builtins and those can be inlined for bigger sizes, profitable
when we can emit a single load to a register for both values (thus
power-of-two size up to word_mode at least).  Desired gimple:

  _1 = VIEW_CONVERT <unsigned long> (a);
  _2 = VIEW_CONVERT <unsigned long> (b);
  _3 = _1 != _2;
  return _3;

and memcmp of size 1 can be inlined as two char loads and subtraction.

Reply via email to