Sync patch from openeuler/gcc - 20230829 part 2 (cherry picked from commit 609cef8ac6ca4de64bed245700975082853ad49a)