This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] IRA: Don't create new regs for debug insns (PR80429)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 18 Apr 2017 11:47:40 +0200
- Subject: Re: [PATCH] IRA: Don't create new regs for debug insns (PR80429)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 57C57C04B317
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 57C57C04B317
- References: <0f785cef9fcf40b5a54e2e2950083caa50d9bdce.1492506999.git.segher@kernel.crashing.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Apr 18, 2017 at 09:30:19AM +0000, Segher Boessenkool wrote:
> In split_live_ranges_for_shrink_wrap IRA also splits regs that are
> only used in debug insns, leading to -fcompare-debug failures.
>
> Bootstrapped and tested on powerpc64-linux {-m32,-m64}. This happens
> on at least GCC 5, so not a regression; but it is trivial and obvious,
> is it okay for trunk anyway?
I think the first question here is if it is beneficial to replace the
regs in DEBUG_INSNs or not. If it is beneficial, then it of course
has to be changed such that it never does
newreg = ira_create_new_reg (dest);
just because it sees DEBUG_INSN uses, but otherwise it should do what it
does now.
So one option is e.g. to split that loop into two, one doing analysis,
i.e. that newreg = ira_create_new_reg (dest);, but not
validate_change (uin, DF_REF_REAL_LOC (use), newreg, true);
and this loop would also ignore DEBUG_INSN_P.
And the other loop, with the same content, just without that newreg = ...
and with the validate_change, as whole guarded with if (newreg),
replacing stuff on all insns.
Or another way to write this is have the loop as currently is, with
if (DEBUG_INSN_P (uin) && (!newreg || debug_insns_seen_p))
{
debug_insns_seen_p = true;
continue;
}
and then another loop done only if (debug_insns_seen_p && newreg)
that would only adjust DEBUG_INSNs.
Jakub