This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rtl-optimization]: Fix post-reload compare elimination pre-pass
- From: Richard Henderson <rth at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 10 Feb 2012 16:26:51 -0800
- Subject: Re: [PATCH, rtl-optimization]: Fix post-reload compare elimination pre-pass
- References: <CAFULd4b2xTuHyQNxpdPjnxmg0OZfhmzWLAwrJskCNCZEULt8gg@mail.gmail.com>
On 02/09/2012 03:47 PM, Uros Bizjak wrote:
> 2012-02-10 Uros Bizjak <ubizjak@gmail.com>
>
> * compare-elim.c (find_comparisons_in_bb): Eliminate only compares
> having mode compatible with the mode of previous compare. Substitute
> compare mode of previous compare with the mode, compatible
> with eliminated and previous compare.
This patch is ok for 4.8.
For 4.6 and 4.7 I would prefer that we simply not eliminate the compare. I.e.
+ enum machine_mode src_mode = GET_MODE (src);
+
/* Eliminate a compare that's redundant with the previous. */
if (last_cmp_valid
+ && src_mode == last_cmp->orig_mode
&& rtx_equal_p (last_cmp->in_a, XEXP (src, 0))
&& rtx_equal_p (last_cmp->in_b, XEXP (src, 1)))
{
...
- last_cmp->orig_mode = GET_MODE (SET_DEST (single_set (insn)));
+ last_cmp->orig_mode = src_mode;
For 4.6 and 4.7, there are only two extant users of this pass and neither
of them use anything besides CCmode before compare-elim.c does its own
manipulation of the modes later.
r~