I recently upgraded MCUXpresso from v11.2.1 to v11.6.0 and tried to rebuild a project developed in 11.2.1. I receive the following compiler warning:
warning: inlining failed in call to '<FunctionName>': --param max-inline-insns-single limit reached [-Winline]
I have made no other changes to the project code or project settings. According to the C/C++ Build Settings that I have configured, -finline-limit is not specified, and so it should revert to the default value.
Why would v11.6.0 fail to inline, while v11.2.1 succeeded?
已解决! 转到解答。
There are two possibilities:
Newer versions of GCC rarely make code that is smaller that past versions.
So the version of GCC that ships with 11.6.0 is making the function larger and is now hitting the limit.
Newer versions of GCC improve the error reporting (they are trying to play catch up with CLANG).
The failure may have been there in the past, the function was not inlined, and it was not reported in the older version.
It seems you can also check the gcc version using the following:
From MCUXpresso project, right-click on Project and select Utilities > Open Command Prompt here.
From the command prompt, execute:
arm-none-eabi-gcc --version
I found the following:
MCUXpresso | v11.2.1 | v11.6.0 |
arm-none-eabi-gcc | 9.2.1 20191025 | 10.3.1 20210824 |
You can check the version of the GCC with a macro:
https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
As for using different versions of gcc/toolchains: you can do this with https://eclipse-embed-cdt.github.io/, but this means a different project setting.
Erich
There are two possibilities:
Newer versions of GCC rarely make code that is smaller that past versions.
So the version of GCC that ships with 11.6.0 is making the function larger and is now hitting the limit.
Newer versions of GCC improve the error reporting (they are trying to play catch up with CLANG).
The failure may have been there in the past, the function was not inlined, and it was not reported in the older version.
It seems there may be a bit of both going on. v11.6.0 reported 5 different functions that failed to inline. From what I can tell, 4 of those were properly inlined when compiled by v11.2.1, and one was not (but no warning was issued).