Change of -finline-limit in MCUXpresso v11.6.0?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Change of -finline-limit in MCUXpresso v11.6.0?

跳至解决方案
2,179 次查看
aberger
Contributor V

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?

标记 (1)
0 项奖励
回复
1 解答
2,164 次查看
bobpaddock
Senior Contributor III

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.

在原帖中查看解决方案

0 项奖励
回复
6 回复数
2,144 次查看
aberger
Contributor V

Is there a way to specify the GCC version in the Project Settings? To avoid having to keep a legacy setup, I'd like to not have my build output tied to the MCUXpresso version.

0 项奖励
回复
2,106 次查看
aberger
Contributor V

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:

MCUXpressov11.2.1v11.6.0
arm-none-eabi-gcc9.2.1 2019102510.3.1 20210824
0 项奖励
回复
2,139 次查看
ErichStyger
Specialist I

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

0 项奖励
回复
2,163 次查看
ErichStyger
Specialist I

The IDE 11.6.0 is using a different/new compiler, so this likely explains it.

0 项奖励
回复
2,165 次查看
bobpaddock
Senior Contributor III

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.

0 项奖励
回复
2,143 次查看
aberger
Contributor V

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).

0 项奖励
回复