For code running in a commercial jet engine, so usually DAL A or DAL B? You should be caught by the first level of verification —- can’t even get past code review, because you don’t have a requirement to tag to trace the useless code back to. If that process failed (and any can), you have the whole climb up the right side of the V. And in the end, if the code is not /so/ useless as to be removed by the compiler, the final check that all generated bytes have traceability should catch it.
A medical issue followed by lack of sufficient follow up should not happen, but they statistically will eventually.