The underlying issue is not a regression but it shows up on a very simple pattern (see gnat.dg/specs/array7.ads) and is not easy to work around.
The fix (https://gcc.gnu.org/pipermail/gcc-patches/2024-August/661798.html) is localized, small and thus considered to be very safe, so I have backported it onto the active release branches. -- Eric Botcazou