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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |missed-optimization
   Last reconfirmed|                            |2024-05-13
     Ever confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
This would work if we'd duplicate the path from a = 0 to *outl = 1; return 0;
but we don't early enough (on GIMPLE) and we don't do that on RTL until
BB reorder where ther's no later pass doing this optimization either.

On GIMPLE we see

  <bb 2> [local count: 1073741824]:
  *outl_4(D) = 0;
  if (c1_6(D) != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 5>; [50.00%]
...
  <bb 5> [local count: 965079152]:
  # a_1 = PHI <1(3), 0(2)>
  *outl_4(D) = a_1;
  return 0;

but I think tracer doesn't consider paths to exit aka tail duplication,
likely because on GIMPLE we force a single return block.  There's also
no partial redundant store elimination.

Reply via email to