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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|wrong code at -O2 and above |[16 Regression] wrong code
                   |on x86_64-pc-linux-gnu      |at -O2 and above on
                   |                            |x86_64-pc-linux-gnu
   Target Milestone|---                         |16.0
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2025-12-09
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

ldist turns it into a "memmove":

```
  <bb 3> [local count: 118111600]:
  # i.6_23 = PHI <_6(7), 1(2)>
  # ivtmp_18 = PHI <ivtmp_19(7), 255(2)>
  _7 = &a + 4;
  _5 = &a + 8;
  _27 = MEM <uint128_t> [(char * {ref-all})_5];
  MEM <uint128_t> [(char * {ref-all})_7] = _27;
  _6 = i.6_23 + 1;
  ivtmp_19 = ivtmp_18 - 1;
  if (ivtmp_19 != 0)
    goto <bb 7>; [89.00%]
  else
    goto <bb 6>; [11.00%]

  <bb 7> [local count: 105119324]:
  goto <bb 3>; [100.00%]
```



Which is fine. But then LIM4 decides move the load out of the loop which is
wrong:
Moving statement _27 = MEM <uint128_t> [(char * {ref-all})&a + 8B];
(cost 20) out of loop 1.

Reply via email to