This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Fix loop-iv-related regression in pr27285.c
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org, rdsandiford at googlemail dot com
- Date: Sat, 21 Feb 2009 08:20:27 -0800
- Subject: Re: RFA: Fix loop-iv-related regression in pr27285.c
- References: <87vdr6qitd.fsf@firetop.home>
On Thu, Feb 19, 2009 at 12:21 PM, Richard Sandiford
<rdsandiford@googlemail.com> wrote:
> Several places in loop-iv.c want to truncate an iv from extend_mode to a
> smaller mode. The problem is that they unconditionally do this using
> simplify_gen_subreg, which is incorrect for !TRULY_NOOP_TRUNCATION
> conversions. This causes gcc.c-torture/execute/pr27285.c to fail on
> mipsisa64-elf with the options "-O3 -funroll-loops".
>
> The simple fix is to use simplify_gen_unary (TRUNCATE, ...) instead.
> simplify_gen_unary knows when it can use subregs, so the change doesn't
> pessmise sane targets. (To be sure, I verified that the patch did
> not change the assembly output for the C and C++ testsuites on either
> x86_64-linux-gnu or i686-pc-linux-gnu, using the options -O3
> -funroll-all-loops.) I think the change is conceptually cleaner too.
>
> While loop-iv.c no longer needs the lowpart_subreg function itself,
> it exported this function to various other rtl passes and targets.
> I therefore moved it into emit-rtl.c instead of deleting it.
>
> Tested on mipsisa64-elf. Also tested with a C-only bootstrap on
> x86_64-linux-gnu; a full test is now in progress. OK to install
> if the bootstrap succeeds? (Sorry for asking before waiting,
> but I realise we're close to branching.)
>
> Richard
>
>
> gcc/
> * loop-iv.c (truncate_value): New function.
> (iv_subreg, get_iv_value, iv_number_of_iterations): Use it instead
> of lowpart_subreg.
> (lowpart_subreg): Move to...
> * emit-rtl.c: ...here.
I believe this patch caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39257
--
H.J.