https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95295
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:4acca1c0635dfa43cd8c4bfe2b22e17909fc23a3 commit r11-609-g4acca1c0635dfa43cd8c4bfe2b22e17909fc23a3 Author: Richard Biener <rguent...@suse.de> Date: Mon May 25 10:09:44 2020 +0200 tree-optimization/95295 - fix wrong-code with SM We failed to compare the rematerialized store values when merging paths after walking PHIs. 2020-05-25 Richard Biener <rguent...@suse.de> PR tree-optimization/95295 * tree-ssa-loop-im.c (sm_seq_valid_bb): Compare remat stores RHSes and drop to full sm_other if they are not equal. * gcc.dg/torture/pr95295-1.c: New testcase. * gcc.dg/torture/pr95295-2.c: Likewise. * gcc.dg/torture/pr95283.c: Likewise.