This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Dead code elimination of dead structure assignments in gcc
- From: Jan Hubicka <jh at suse dot cz>
- To: Reva Cuthbertson <reva at cup dot hp dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 23 Jan 2002 10:18:28 +0100
- Subject: Re: Dead code elimination of dead structure assignments in gcc
- References: <3C4E0FA3.F82706B7@cup.hp.com>
> 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