https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110726
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Sergei Trofimovich from comment #7) > Silly question: I would expect -O0 not to perform any simplifications like > that. Does `gcc` have a knob to disable `match.pd` templates? Or some of > them are crucial for correctness? Some are crucial for correctness usually dealing with c++. you could always use dbg_cnt to try to narrow down which one is failing. See https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/dbgcnt.def;h=9e2f1d857b49c6c331cc7d1c419eafa0f2403e96;hb=HEAD For on how to use dbg_cnt match is the counter here. Also for generic folding -fdump-tree-original-folding will have the debug info on what match pattern was applied during "fold" (of generic).