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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|middle-end                  |tree-optimization

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So looking at what other compilers do here.
ICC and MSVC do what GCC did in GCC 4.1.2.
LLVM does similar to what GCC does now except they also push the -a to below
the if statement.

If we have:
void foo (int);
void bar (void);
int g(int, int);

int
test (int a)
{
  int r;

  if (r = -a)
    foo (r);
  else
    bar ();

  return r;
}

----- CUT ----
LLVM is able to produce the neg/branch combo now while GCC is not.

Reply via email to