Comments

Hello,
IMHO, no RTL pass implementation file should have to include tree.h.
So ira-conflicts.c shouldn't need tree.h. The reason it needed it, was
because there is code to avoid putting user variables in callee
clobbered registers, and ira-conflict.c looked at DECL_ARTIFICIAL
(REG_EXPR (reg)). But it can just look at REG_USERVAR_P(reg) instead,
which is simper and cleaner.
Likewise, IMHO no CFG implementation files should need tree.h, because
the CFG should be IR agnostic. But mcf.c needed tree.h for
lang_hooks.decl_printable_name from langhooks.h. It can use
current_function_name() instead.
Bootstrapped and tested on powerpc64-unknown-linux-gnu. OK for trunk?
Ciao!
Steven
* mcf.c: Do not include tm.h, tree.h, and langhooks.h.
(dump_fixup_graph): Use current_function_name.
(adjust_cfg_counts): Likewise.
* ira-conflicts.c: Do not include tree.h.
(ira_build_conflicts): Use REG_USERVAR_P instead of DECL_ARTIFICIAL.

On Mon, Jul 16, 2012 at 9:35 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Sun, Jul 08, 2012 at 02:44:15PM +0200, Steven Bosscher wrote:>> IMHO, no RTL pass implementation file should have to include tree.h.>> So ira-conflicts.c shouldn't need tree.h. The reason it needed it, was>> because there is code to avoid putting user variables in callee>> clobbered registers, and ira-conflict.c looked at DECL_ARTIFICIAL>> (REG_EXPR (reg)). But it can just look at REG_USERVAR_P(reg) instead,>> which is simper and cleaner.>> But it regresses PR53948.
And your proposed solution in the PR is to revert the patch? I don't
see how that helps, and frankly I don't think it's a constructive
attitude.
The variable that is optimized out is a user variable. Instead of
reverting my patch, we should find out why REG_USERVAR_P isn't set for
it.
Ciao!
Steven