This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: dead code removal in flow.c cleanup
- From: Jan Hubicka <jh at suse dot cz>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: jh at suse dot cz, gcc-patches at gcc dot gnu dot org
- Date: Mon, 18 Mar 2002 15:45:50 +0100
- Subject: Re: dead code removal in flow.c cleanup
- References: <200203180106.UAA25616@caip.rutgers.edu>
> Jan,
>
> I believe this patch:
>
> > Sun Mar 3 18:50:48 CET 2002 Jan Hubicka <jh@suse.cz>
> >
> > * flow.c (ndead): New variable.
> > (propagate_block_delete_insn): Use delete_insn_and_edges; remove
> > BB argument; update callers.
> > (propagate_block_delete_libcall): Use delete_insn_chain_and_edges.
> > (life_analysis): Do not call purge_all_dead_edges.
> > (update_life_info): Return number of deleted insns; print statistics.
> > (update_life_info_in_dirty_blocks): likewise.
> > (delete_noop_moves): Use delete_insn_and_edges; print statistics;
> > return number of insns deleted.
>
> introduced an uninitialized variable warning which I believe needs
> attention:
>
> > flow.c:764: warning: `ndead' might be used uninitialized in this function
>
> If you look at the code in question in the function
> update_life_info_in_dirty_blocks, `ndead' is clearly uninitialized if
> and when (n==0). I don't know if that's ever possible, but if it is
> then the function returns (ndead == unitialized garbage).
>
> Would you please take a look and take steps to remove the warning?
Oops, I already fixed that in my tree and somehow forgot to push it into
the tree. I will do so ASAP.
Honza
>
> Thanks,
> --Kaveh
>
> PS: minor nit: ndead in this function shadows a static global, this
> can be confusing.
>
> --
> Kaveh R. Ghazi Director of Systems Architecture
> ghazi@caip.rutgers.edu Qwest Global Services