This is the mail archive of the gcc-patches@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 removal in flow.c cleanup


> 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


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