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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
          Component|tree-optimization           |middle-end

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Work around use GNU C++ VLA extension:
```
void mgsort(int l, int r) {
    if (l == r) {
        return;
    }
    int mid = (l + r) >> 1;
    mgsort(l, mid);
    mgsort(mid + 1, r);

    int t = 0; // not const or constexpr to force VLA
    int b[N+t];
    std::merge(a + l, a + mid + 1, a + mid + 1, a + r + 1, b + l);
    std::memcpy(a + l, b + l, sizeof(int) * (r - l + 1));
}
```

Reply via email to