https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80574
--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> --- (In reply to SztfG from comment #3) > Georg-Johann Lay, GCC not always do things better if use static inline > function instead macro. He did not claim it was always better... > For example, this code: Please don't mix unrelated issues, you can file a different bug if you want that one addressed. In that case, it is because we have an old optimization in fold_unary (like other "do ... if ... simplifies" it is not straightforward to move it to match.pd) and thus only applies when everything is part of the same expression in the source code. /* Convert ~(X ^ Y) to ~X ^ Y or X ^ ~Y if ~X or ~Y simplify. */ If you use even less macros and more lines, things optimize a bit better: m_xnor: TYPE tmp=!!a^!!b; return !tmp; but we still have some discrepancy where we optimize (a^b)==0 but not ~(a^b) (for _Bool type). This will be much more convenient to analyze in a different bug report.