https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81601
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I think the easiest fix is move optimize_bit_field_compare from where it is currently done and do it only in some late gimple pass, around pass_fold_builtins/store merging or so? Dunno which exact one though.