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

            Bug ID: 92342
           Summary: [10 Regression] a small missed transformation into
                    x?b:0
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64-linux-gnu

Take these two functions:
int f(int a,int b, int c)
{
  return a==c?b:0;
}

int g(int a, int b, int c)
{
  return b & -(a==c);
}
---- CUT ----
We used to produce the same code generation for both of them:
        cmp     w0, w2
        csel    w0, w1, wzr, eq
        ret


But in GCC 10 we produce for g:
        cmp     w0, w2
        csetm   w0, eq
        and     w0, w0, w1
        ret

I think this was introduced by:
2019-05-09  Segher Boessenkool  <seg...@kernel.crashing.org>

       * combine.c (combine_simplify_rtx): Don't make IF_THEN_ELSE RTL.

Reply via email to