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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=110199
   Last reconfirmed|                            |2024-04-03
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. Reduced testcase without the need of inlining nor atomics:
```
int g(int);
int h(int);

int f(int a, int b)
{
  while (true)
   {
      int t = a < b ? a : b; // MIN<a,b>
      if (b <= a)
        return a; 
      { a = g(a); if (h(t)) return t; }
        // t here should be old a before the assignment from `g(a);`
   }
}
```

As far as I can tell this is basically slightly more complex version of PR
110199 really wehre the MIN (MAX) has 2 usages. Note if we the usage of t in
`h(t)` the trunk (due to  PR 110199) is able to optimize it correctly to
`return a`.

Reply via email to