Open
Description
While generating code for an Cortex-M0 I noticed that using core::fmt to generate printable output generates extremely bloated code, even when just using a plain string as format.
According to @rkruppe on IRC this is most likely due to a missed elimination of dead code by LTO.
A stripped down example can be found here:
https://gist.github.com/anonymous/7cfc8b881fcb8fdc792428dd772502cb
The generated assembly is here:
https://gist.github.com/anonymous/9cfa48e53e3b1c8ba1ddb69f8ae3ea3b
I also have an example (serial_slow_helloworld) in this repo https://github.com/therealprof/stm32f042.git . xargo build --release --examples
will create a binary demonstrating the problem.
This happens for me with:
rustc 1.20.0-nightly (8f1339af2 2017-07-16)
binary: rustc
commit-hash: 8f1339af2e5d1b33ec9ee3c8a3c531bcd61770fc
commit-date: 2017-07-16
host: x86_64-apple-darwin
release: 1.20.0-nightly
LLVM version: 4.0
Metadata
Metadata
Assignees
Labels
Category: An issue proposing an enhancement or a PR with one.Issue: Problems and improvements with respect to binary size of generated code.Issue: Problems and improvements with respect to performance of generated code.Relevant to the compiler team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.Working group: Embedded systems