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

--- Comment #9 from Yuri Rumyantsev <ysrumyan at gmail dot com> ---
It looks like such transformation is profitable if only def statements have a
single use, i.e. it looks reasonable for 
   if (255 - a) > (255 -b) /* a,b have char type.  */
but it does not look reasonable for attached test-case since after it we missed
min/max recognition, namely,

        c = 255 - r; /* c has mulitple uses!  */
        m = 255 - g; /* likewise.  */
        y = 255 - b; /* likewise.  */
        if (c < m) 
          k = MIN (c, y);
        else
          k = MIN (m, y);
        *write++ = c - k;

Reply via email to