Weird godbolt results for opt-level=s

⚓ Rust    📅 2025-04-28    👤 surdeus    👁️ 4      

surdeus

Warning

This post was published 115 days ago. The information described in this article may have changed.

I encountered a weird result while inspecting assembly for my piece of code compiled with opt-level=s:

It looks as if dead code elimination was not applied here for some reason. The assembly generated for to_u32s (the only public function in the crate) does not call any other code snippets presented in the generated assembly. Is it expected? I know that unused functions may be eliminated later by linker, but it still looks weird.

1 post - 1 participant

Read full topic

🏷️ rust_feed