https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67955
Bug ID: 67955 Summary: tree-dse does not use pointer info Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org Target Milestone: --- Consider this testcase, with dead store '*p = 1': ... int f () { int a; int *p = &a; *p = 1; a = 2; return a; } ... We compile with -O2 -fno-tree-ccp -fno-tree-forwprop -fno-tree-fre. At dse1 we have ... f () { int * p; int a; int _5; <bb 2>: p_1 = &a; *p_1 = 1; a = 2; _5 = a; a ={v} {CLOBBER}; return _5; } ... So, the dead store '*p_1 = 1' has not been eliminated. However, at ealias we already know: ... Alias information for f Aliased symbols a, UID D.1757, int, is addressable Call clobber information ESCAPED, points-to non-local, points-to vars: { } Flow-insensitive points-to information p_1, points-to vars: { D.1757 } ... So, we could use points-to info in dce.