Optimising compilers do a lot more than drop code with no effect (and TBH most decent linter tools will pick that up for you anyway), I've seen them generate machine code that bore virtually no relationship to the C source, with loop unrolling, function call inlining, operation interleaving etc. etc.
https://cacm.acm.org/magazines/2020/2/242347-optimizations-i... has some interesting examples.