This is the mail archive of the 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]

[patch][DF] do not call df_insn_delete in remove_insn, only unlink the insn


emit-rtl.c:remove_insn calls df_insn_delete on insns that have not
been emitted to the insn chain, and therefore don't have DF cache
entries yet. I think it's wrong for remove_insn to call

delete_insn should be used to completely destroy an insn and all
associated data including DF caches. Calling remove_insn to really
delete an insn is also wrong because LABEL_NUSES isn't updated.
Fortunately, almost all code already uses delete_insn so this patch is

remove_insn should only unlink an insn from the current insns chain
(the function body or an open start_sequence chain).

The attached patch makes it so... In fact, without this patch,
sel-sched-ir.c had to work around this problem (remove_insn doing
df_insn_delete) but it was leaking DF caches as a result. Probably
there are other places that can be simplified now to use remove_insn
instead of hacking the insn chain by hand. I've looked at all
remove_insn and delete_insn callers to make sure this patch does

In general I think it's wrong for emit-rtl to have any dependence on
DF (DF depends on RTL, but not the other way around) but that's not
something I want to work on right now.

Bootstrapped&tested on x86_64-unknown-linux-gnu. OK?


Attachment: remove_insn_no_DF.diff.txt
Description: Text document

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