This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Why does IRA force all pseudos live across a setjmp call to be spilled?
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: GCC <gcc at gcc dot gnu dot org>, Vladimir N Makarov <vmakarov at redhat dot com>, Pat Haugen <pthaugen at linux dot vnet dot ibm dot com>
- Date: Fri, 2 Mar 2018 22:55:37 +0300 (MSK)
- Subject: Re: Why does IRA force all pseudos live across a setjmp call to be spilled?
- Authentication-results: sourceware.org; auth=none
- References: <141cfa78-f202-029a-e530-24e657692bff@vnet.ibm.com>
On Fri, 2 Mar 2018, Peter Bergner wrote:
> But currently ira-lives.c:process_bb_node_lives() has:
>
> /* Don't allocate allocnos that cross setjmps or any
> call, if this function receives a nonlocal
> goto. */
> if (cfun->has_nonlocal_label
> || find_reg_note (insn, REG_SETJMP,
> NULL_RTX) != NULL_RTX)
> {
> SET_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj));
> SET_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj));
> }
>
> ...which forces us to spill everything live across the setjmp by forcing
> the pseudos to interfere all hardregs. That can't be good for performance.
> What am I missing?
FWIW there's a similar issue with exceptions where IRA chooses memory
for pseudos inside the loop even though the throwing call is outside:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82242#c3
Alexander