Take the following:
char Bool_Glob;
void f(void)
{
  Bool_Glob = 0;
  Bool_Glob = 1;
}

There should be only one store to Bool_Glob in the last tree dump.

The corresponding pointer example works correctly:
int f(char *Bool_Glob )
{
  *Bool_Glob = 0;
  *Bool_Glob = 1;
}

-- 
           Summary: DSE is not doing its job for global variables
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18880

Reply via email to