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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Missed DSE in simple code   |Missed DSE in simple code
                   |due to other stores being   |due to interleaving sotres
                   |conditional                 |

--- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
the other store being conditional is not the core issue. Here we miss DSE too:

#include <stdio.h>
int a;
short p,q;
void
test (int b)
{
        a=1;
        if (b)
          p++;
        else
          q++;
        a=2;
}

The problem in DSE seems to be that instead of recursively walking the
memory-SSA graph it insist the graph to form a chain. Now SRA leaves stores to
scalarized variables and even removes the corresponding clobbers, so this is
relatively common scenario in non-trivial C++ code.

Reply via email to