https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385

--- Comment #22 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #18)
> Comment on attachment 48302 [details]
> Untested fix
> 
> +         /* IPA-SRA does not analyze other types of statements.  */
> +         gcc_unreachable ();
> Won't this ICE on any is_gimple_debug stmt?  Those should be just ignored
> and normal SSA_NAME handling should DTRT for those.

Yeah, it most probably will, I wrote it was only very mildly tested
(i.e. I only ran IPA testcases on it) - I wanted to post what I had
before I had to stop working on this for a few hours.

> As for PHIs, can you just gsi_remove them?
> Looking at tree-ssa-dce.c, it uses remove_phi_node rather than
> gsi_remove for PHIs.  And for non-PHIs, it calls release_defs after
> gsi_remove.

You are again most probably right, I keep forgetting about this.

> 
> Plus, I think in isra_track_scalar_value_uses for non-is_gimple_{debug,call}
> we should punt if !flag_tree_dce, i.e. when user asked not to perform dead
> code elimination.  Though, guess that hunk should be added only after this
> is tested (and perhaps the testcase or its copy should use
> -fdisable-tree-dce or whatever other way to avoid doing DCE even when
> flag_tree_dce is non-zero.

OK, that makes sense.  I'd slightly prefer the patch in comment #11
for this so that direct passes of a parameter to another function
without any modification is still not considered as doing DCE - but I
also do not really care too much.

Reply via email to