It turns out that the optimizations may correctly encode a Fortran character object as an integer even when the character length is greater than 1.
Also, it is probably not the AsmPrinter's job to catch the result of a bad transformation, which the removed assertion appears to be doing.
This is a follow-up to https://reviews.llvm.org/D100015.
Can you remove all attributes that are not strictly necessary (especially the ones in quotes)?