This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Dead Store Elimination


Hi,

A possible silly question about the dead store elimination pass. From
the documentation it is clear that the store S1 below is removed by
this pass (in dse.c)

*(addr) = value1;          // S1
.....
.....
*(addr) = value2          // S2 .. No read of "addr" between S1 and S2.
......
             = *(addr)       // Load
.......
end_of_the_function

However, consider a different example.

*(addr) = value1;      // S1
......
.....
end_of_the_function.

i.e. there is no store Sn that follows S1 along any path from S1 to
the end of the function and there is no read of addr following S1
either. Is the dse pass expected to remove such stores ? (I am
inclined to think that it should, but I am seeing a case where dse
doesnt remove such stores) . Further is the behaviour expected to be
different if the "addr" is based on  "fp" ?

TIA,
Pranav


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]