https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63404
--- Comment #4 from Jiong Wang <jiwang at gcc dot gnu.org> --- sorry for causing the trouble. the reason might be the "flag" is an implified register while it's not take into account in current shrink-wrap reg read/write analysis. I will revert my patch temperarily if I couldn't find a proper fix today.