armgcc 13.2.1 optimization issue

Hello,

I got an issue when using armgcc 13.2.1 optimization level Os.

There is a package to reproduce this issue, it is a hardware independent project. The issue is in function MECC_GetSingleErrorInfo, the tempPosLow is 4, tempPosHigh is 0, so the singleErrorInfo.singleErrorPosHigh should be 0, but it is not.

test_code.zip

compile flags: arm-none-eabi-gcc -std=gnu99 -Os -fno-common -g -gdwarf-4 -c -ffunction-sections -fdata-sections -fno-builtin -mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -fstack-usage -MMD -MP linker flags: arm-none-eabi-gcc -nostdlib -Xlinker -no-warn-rwx-segments -Xlinker --gc-sections -Xlinker --sort-section=alignment -Xlinker --cref -mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb

Could you please help?

Thanks.