Partial dead code elimination

Gohil Dwijesh
Mon Jun 24 08:11:00 GMT 2019

It seems that partial dead code elimination has not been implemented by the
gcc and icc. I saw dump files dumped by the gcc using the following

    gcc -O3 -fdump-tree-all <file_name.c>

I can not even find a single pass for partial dead code elimination though
in the research papers(Partial Dead Code Elimination, June 1994) algorithm
is clearly mentioned. Applying partial dead code elimination, execution
time either remains the same or decreases.* I am wondering, why is it not
implemented by the recent compilers?*

example of partial dead code elimination

x = 4;                          y=7;                            y = 7;
y = 7;                          if(cond) then                   if(cond)
if(cond) then                       x = 4;                          x = 3;
    x = 3;      ------------->      x = 3;    --------------->  else
else                            else                                x = 4;
    z = 4;                          x = 4;                          z = 4;
end if;                             z = 4;                      end if;
out(x);                         end if;                         out(x)

More information about the Gcc-help mailing list