https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66127
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- I think the proper solution is to mark all problematic operations with TREE_SIDE_EFFECTS so that the side-effects are preserved when omitting operands.