Do we have a process for filing upstream LLVM bugs? I've translated this Rust to this C. In either case, I expect that the
please_delete function is not called, as it's statically obvious that that branch cannot be reached. GCC successfully removes the call (compiling bar to
Interestingly, if the
len_utf8 function is marked as
inline(never) the problem disappears
which is.. not intuitive
To be clear, the problem here is that an optimization which would be correct and desirable does not happen? I ask because "misoptimization" (like "miscompile") usually refers to an optimization being incorrect, changing the behavior of the program.
@rkruppe yep, not a case of miscompilation here
maybe better topic title would be "missed optimization" ?