https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122380
--- Comment #21 from Richard Biener <rguenth at gcc dot gnu.org> --- Created attachment 63921 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63921&action=edit patch This is what I have. I think the 'prefer' function needs amending, but I don't have testcases but I'd like to have them. The testcase from this PR does not involve mixing of expressions but suffered solely from a mixup of expressions from the VN table during the phi_translate lookup on the paths where the VUSEs get the same. Thus a workaround in compute_avail where all the others reside is not possible. 'prefer' does not handle mixing of two correctly (but randomly), like on a CFG similar to the added gcc.dg/torture/pr65270-3.c testcase that shows the issue for mixing up alignment. Similar for TBAA. One might be able to trick PRE into inserting the wrong expression exercising the treepre_insert debug counter, but that's not good for a stable testcase(?)
