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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ubizjak at gmail dot com

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 62694
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62694&action=edit
x86 target patch

x86 target patch that compiles the following testcase (gcc -O2):

--cut here--
int f(int);
int g(int);

int f1(unsigned a, unsigned b)
{
  unsigned t = a < b;
  int tt = a + t;
  if (tt < 0)
    return f(tt);
  return g(tt);
}

int f2(unsigned a, unsigned b)
{
  unsigned t = a < b;
  int tt = a - t;
  if (tt < 0)
    return f(tt);
  return g(tt);
}
--cut here--

to:

f1:
        cmpl    %esi, %edi
        adcl    $0, %edi
        js      .L4
        ...

f2:
        cmpl    %esi, %edi
        sbbl    $0, %edi
        js      .L7
        ...

instead of:

f1:
        cmpl    %esi, %edi
        adcl    $0, %edi
        testl   %edi, %edi
        js      .L4
        ...

f2:
        cmpl    %esi, %edi
        sbbl    $0, %edi
        testl   %edi, %edi
        js      .L7
        ...

Reply via email to