This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, MIPS] Patch to fix MIPS optimization bug in combine
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Steve Ellcey <sellcey at imgtec dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Catherine Moore <clm at codesourcery dot com>, Matthew Fortune <matthew dot fortune at imgtec dot com>
- Date: Thu, 22 Oct 2015 03:52:37 +0800
- Subject: Re: [Patch, MIPS] Patch to fix MIPS optimization bug in combine
- Authentication-results: sourceware.org; auth=none
- References: <90e95b88-ed1a-44a0-9f98-c855156ef97c at BAMAIL02 dot ba dot imgtec dot org> <20151021194725 dot GD19661 at gate dot crashing dot org>
On Thu, Oct 22, 2015 at 3:47 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> Hi,
>
> On Wed, Oct 21, 2015 at 09:44:25AM -0700, Steve Ellcey wrote:
>> (jump_insn 16 15 17 2 (set (pc)
>> (if_then_else (ne (subreg:SI (reg:DI 207) 4)
>> (subreg:SI (reg:DI 196 [ *last_3(D)+-4 ]) 4))
>> (label_ref:DI 35)
>> (pc))) x.c:21 472 {*branch_equalitysi}
>> (expr_list:REG_DEAD (reg:DI 207)
>> (int_list:REG_BR_PROB 8010 (nil)))
>> -> 35)
>
> Why does *branch_equalitysi allow these subregs if it cannot handle them?
It can handle subreg here if the register was signed extended from SI
mode in the first place (I have seen cases where we want to use the
subreg). In this case combine should not have generated the subreg
but rather truncation for this comparison. See my other email about
this.
Thanks,
Andrew
> Not just combine can generate code like this (in theory at least).
>
>
> Segher