The https://gcc.gnu.org/PR95719 bugfix has been backported also to the 8.x branch before the branch has been closed with gcc 8.5.0 release. Unfortunately, that fix caused a regression which can be seen e.g. when building libreoffice, as reported in https://gcc.gnu.org/PR100797. The fix that was added to gcc 9.x needs to be backported to our gcc 8.5.0.
Verified: gcc-8.5.0-2.el8
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Low: gcc security and bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:4386