https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81555
--- Comment #4 from Dmitry Babokin <babokin at gmail dot com> --- (In reply to Marc Glisse from comment #3) > -fno-tree-reassoc should help both. It helps. > It is often a combination of optimizations that causes the bug. Reassoc is > doing a good transformation, but it leaves wrong information around, which > only matters if some other pass (rightfully) takes advantage of that > information. Still, it was good to report both, and I expect we may add (a > modified version of) both to the testsuite once this is fixed, thanks. Agree, two regression tests are better than one. As a side note, it would be really useful to have a general mechanism for blaming particular optimization by turning off optimizer after certain point (defined through command line switch). Clang and icc both have such mechanism and it's extremely useful. In clang it's "-mllvm -opt-bisect-limit=X". So it enables automated attribution of the bug to particular optimization. Of course it's not 100% precise, but in most of the cases it points to the right place. In other cases it gives good clue where to start the investigation.