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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2015-01-21 00:00:00         |2016-9-3

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
here is a much simpler example:
float f(int a, float b, float c, float d)
{
  if (a)
    return c + d;
  return b + d;
}

float f1(int a, float b, float c, float d)
{
  float e;
  if (a)
    e = c;
  else
    e = b;
  return e + d;
}

For aarch64 we get:
f:
        cbnz    w0, .L5
        fadd    s0, s2, s0
        ret
        .p2align 3
.L5:
        fadd    s0, s1, s2
        ret
...
f1:
        cmp     w0, 0
        fcsel   s0, s1, s0, ne
        fadd    s0, s0, s2
        ret

These two functions should produce the same code.

Reply via email to