[Bug tree-optimization/126415] [17 regression] Wrong code at -O2/3/s on x86_64-pc-linux-gnu since r17-2078

"rguenth at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126415

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
   p1.0_1 = (unsigned char) p1_5(D);
   _2 = p1.0_1 + 159;
   _3 = (char) _2;
-  _7 = (unsigned int) _3;
-  _10 = _7 + 97;
+  _10 = (unsigned int) p1_5(D);

I'll note that this must be an error in the pattern conditions, that it
"misfires" outside of VN isn't the issue.

This is because even "inside VN" (op! @0 { inner_cst; }) isn't just
a hashtable lookup for the expression itself.  Even the hand-coded
variant with vn_nary_build_or_lookup will simplify.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.