-
Notifications
You must be signed in to change notification settings - Fork 3k
Make ARMC5 and IAR develop profile also size optimized #10813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Due to some historical reasons ARMC 5 compiler behaves very differently compared to others (GCC, IAR, ARM C 6) as it optimizes performance rather than size (like the others). All compilers should behave the same way with the same profile, thus ARM C 5 should also drive towards size (space).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, the original motivation for this was that ARM C 5 Otime produced similar code size to GCC 4 Ospace, and there was no point taking even less ROM than GCC, if we were testing all 3 toolchains in parallel - if GCC Ospace fitted then ARM C Otime would also fit.
GCC 6 and later produce much better ARM code, so ARM C needs Ospace to match it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IAR could also use "-Ohz" instead.
I would also fix the Debug profile. With current Mbed OS profile, you cannot compile PDMC with Mesh stack using Mbed OS version of debug profile.
https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/profiles/size.json
https://github.com/ARMmbed/mbed-cloud-client-example/blob/master/profiles/debug_size.json
Previous profile tweak discussions for reference: #2600, #2973 and #5274. Agree on IAR. I think it makes sense for all toolchains to go for the same speed/size/balance setting, given the same profile name. For comparison, "release" currently selects all toolchains as space, and "debug" is low/no optimisation for all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I'm assuming it doesn't cause troubles with binaries in the tree. Probably should go to 5.14, but I'm happy to be challenged here.
IAR is also performance optimizing instead of size optimizing in develop profile. Align also that (review feedback).
I am not asking this for 5.13, it's too late for that. 5.14 (or next feature release) is OK as a target. |
@bulislaw - should not the binary stuff (if there would be any incompatibility) be caught in CI, if there was any issue? Should not be though, this doesn't change the way the binaries are formatted etc. and for all we know - the binaries could already now be size optimized - that fully depends on what settings the developer creating the binaries used (we know for a fact that all bootloaders we provide are size optimized). |
Set for 5.14 , we got some time to get this tested on master. This is breaking change and should be set as one (PR type) + release notes addition needed. This should be also reviewed by tools team/web/studio team - as it changes the online compiler (they use develop profile as I recall). cc @ARMmbed/mbed-os-tools @arekzaluski
+1 for the references @kjbracey-arm . |
I would disagree on the "breaking change". It just changes what the compiler emphasizes. It should not break any code or cause malfunctions (with the exception of potential compiler bugs). |
Yes, it shouldn't be a breaking change, and it shouldn't affect binary compatibility, although I can imagine some sort of exporter/online tool glitch. But it still isn't an actual bug fix, which is what rules it out of backport to patch release. |
I'd agree that this shouldn't be a breaking change, but there are just too many combinations of program, exporter, toolchain, device and profile to make full testing a practical consideration. Consequently almost any change here has the potential for breaking something. If this does cause some sort of exporter/online compiler glitch then it is unlikely we'll see it until someone complains, at which point finding the problem will be much more difficult. |
ci started |
Test run: FAILEDSummary: 6 of 7 test jobs failed Failed test jobs:
|
Will restart testing (internal CI error) |
CI restarted |
Test run: FAILEDSummary: 1 of 11 test jobs failed Failed test jobs:
|
Test failure not related, known issue on master |
Restarted entire pipeline |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
I believe this one is ready and will be merged later today |
Description
Due to some historical reasons ARMC 5 compiler behaves very
differently compared to others (GCC, IAR, ARM C 6) as it optimizes
performance rather than size. The compilers should behave the same
way with the same profile, thus ARM C 5 should also drive towards
size.
Pull request type
Reviewers
@kjbracey-arm @bulislaw @0xc0170
Release Notes