Even with the fix the code assumes that Lisp_Object is aligned at least as strictly as void *; this should be verified. Plus, if the alignments are the same Emacs can avoid a runtime check each time through the loop, which should help branch prediction. I installed the attached into master; if it fixes Ulrich's problem I think this should be backported to emacs-26. Thanks to Ulrich, Eli, and Andreas for reporting this and suggesting the fix.