[Bug tree-optimization/94274] fold phi whose incoming args are defined from binary operations

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 23 12:59:06 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94274

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Detecting common beginnings / endings in branches is something gcc does very
seldom. Even at -Os, for if(cond)f(b);else f(c); we need to wait until
rtl-optimizations to get a single call to f. (of course the reverse
transformation of duplicating a statement that was after the branches into
them, if it simplifies, is nice as well, and they can conflict)
I don't know if handling one such very specific case (binary operations with a
common argument) separately is a good idea when we don't even handle unary
operations.


More information about the Gcc-bugs mailing list