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]

Re: Dead code elimination of dead structure assignments in gcc


>     If I change the program slightly so I'm just using integers
> instead of a structure containing integers, all the dead code is
> eliminated.  Any ideas as to why this is happening?  I've been looking
> at propagate_block() and insn_dead_p() in flow.c to find out why
> the code is not considered dead, but I'm not familiar enough
> with these routines to understand why gcc does not consider the
> code dead.   Is this a known problem with structures?

The problem is that operation on scalar variables are represented as
operations on registers, while operations on structures as operations
with stack slots.
Gcc does liveness analysis of registers and elliminate the code, but it
does not do the same for memory locations, so the code remains there.

This will be probably solved once the AST optimizers take place (see
projects page), but that will not happen in 3.1.x.

Honza
> 
> 
> Thanks!
> 
> Reva Cuthbertson
> reva@cup.hp.com


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