This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Fix loop-iv-related regression in pr27285.c


On Sat, Feb 21, 2009 at 8:48 AM, Richard Sandiford
<rdsandiford@googlemail.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>> 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
>
> Sorry for the breakage.  I've reverted the patch.
>

Thanks. I added PR bootstrap/39257 in ChangeLog.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]