https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118867
--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #8) > (In reply to Patrick Palka from comment #7) > > > Would be useful to have a bisect on where the original testcase in comment > > > #0 started to warn. > > GCC 14 compiling GCC 15 preprocessed sources also emits the warning, while > > GCC 15 compiling GCC 14 preprocessed sources doesn't emit the warning, which > > suggests it started with a libstdc++ commit. AFAICT it started with > > r15-5909-gf29d1b5836790e "libstdc++: Add fancy pointer support to std::list > > [PR57272]". > > oh, that makes even more sense here. We still have a missed optmization on > the gimple level. that is related to my reduced testcase. Just to clarify here, the reason why it works in GCC 14 is that we got: ``` _30 = listJets.D.31591._M_impl._M_node.D.14392._M_next; if (&listJets.D.31591._M_impl._M_node.D.14392 == _30) goto <bb 19>; [5.50%] else goto <bb 9>; [94.50%] <bb 9> [local count: 118111600]: if (&listJets.D.31591._M_impl._M_node.D.14392 != _30) goto <bb 10>; [89.00%] else goto <bb 22>; [11.00%] ``` Which DOM could look up the eq version of the conditional in bb 9 and get the expected answer. While in GCC 15, there are 2 different representations used for the `&listJets.D.31591._M_impl._M_node.D.14392` so we end up with a lookup that missed that out. I wonder if we could canonical to the MEM_REF form to do the lookup then.