Skip to content
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

rustc wantonly inlines drop glue with -O #18864

Closed
comex opened this issue Nov 11, 2014 · 2 comments
Closed

rustc wantonly inlines drop glue with -O #18864

comex opened this issue Nov 11, 2014 · 2 comments
Labels
A-codegen Area: Code generation

Comments

@comex
Copy link
Contributor

comex commented Nov 11, 2014

When investigating the cause of large binary sizes, even with -O, I found that at least one of my functions, do_insn, is about 64K all by itself, despite being not all that complicated (even after inlining): decompiling the binary code with Hex-Rays shows that the vast majority of it is extremely repetitive drop glue, which seems like it's being inappropriately inlined. This does not happen without -O.

Frankly... this is a mess. When I tried to reduce the code in even small ways, the blowup stopped happening: making i_phi #[inline(never)] reduces the total size of the binary by some 60K, while changing the implementation of get to unimplemented!() drastically reduces the size of do_insn even if it's marked inline(never). Faced with this, I'm not really sure what to do other than post the random WIP crappy code I'm working on and hope that a general issue can be identified without looking too closely. I know this is the worst possible thing to receive as a bug report, but for now that's the best I can do.

Is there any way to inline(never) drop glue? If not, it would be nice to have.

https://gist.github.com/comex/24abeab6b99680b045ca contains the Hex-Rays output, the source code (although it will not build without other files), and the LLVM IR produced with -O.

@comex comex changed the title rustc wantonly inlines drop glue with -O produces the equivalent of ~10,000 lines of C (with -O) as drop glue for a relatively small function rustc wantonly inlines drop glue with -O Nov 11, 2014
@steveklabnik steveklabnik added the A-codegen Area: Code generation label Jan 27, 2015
@steveklabnik
Copy link
Member

@comex are you still seeing this happen? A lot has changed in two years.

@Mark-Simulacrum
Copy link
Member

Closing. No reply and no code sample to reproduce. Please reopen if this is still reproducible with a set of steps to do so.

lnicola pushed a commit to lnicola/rust that referenced this issue Jan 7, 2025
…ostics-clearing

fix: Fix diagnostics not clearing between flychecks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation
Projects
None yet
Development

No branches or pull requests

3 participants