This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix combiner move_deaths DEBUG_INSN handling (PR target/84614)
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Biener <rguenther at suse dot de>, Jeff Law <law at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 1 Mar 2018 17:47:35 -0600
- Subject: Re: [PATCH] Fix combiner move_deaths DEBUG_INSN handling (PR target/84614)
- Authentication-results: sourceware.org; auth=none
- References: <20180301231351.GV5867@tucnak>
Hi Jakub,
On Fri, Mar 02, 2018 at 12:13:51AM +0100, Jakub Jelinek wrote:
> prev_real_insn doesn't skip over DEBUG_INSNs, on aarch64 on this
> testcase we get both -fcompare-debug failure and wrong-code with -g.
>
> Instead of adding yet another two:
> do
> insn = prev_real_insn (insn);
> while (DEBUG_INSN_P (insn));
> loops, this patch introduces new functions that stop only at
> NONDEBUG_INSN_P.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, tested with
> cross to aarch64-linux on the testcase, ok for trunk?
Looks good to me, thanks! (The non-combine parts are arguably obvious
and trivial cleanup).
Segher
> 2018-03-02 Jakub Jelinek <jakub@redhat.com>
>
> PR target/84614
> * rtl.h (prev_real_nondebug_insn, next_real_nondebug_insn): New
> prototypes.
> * emit-rtl.c (next_real_insn, prev_real_insn): Fix up function
> comments.
> (next_real_nondebug_insn, prev_real_nondebug_insn): New functions.
> * cfgcleanup.c (try_head_merge_bb): Use prev_real_nondebug_insn
> instead of a loop around prev_real_insn.
> * combine.c (move_deaths): Use prev_real_nondebug_insn instead of
> prev_real_insn.
>
> * gcc.dg/pr84614.c: New test.