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: [patch, combine] Bit-field insertion optimization #2


On Mon, Dec 13, 2010 at 5:41 PM, Chung-Lin Tang <cltang@codesourcery.com> wrote:
> On 2010/12/14 07:06, Andrew Pinski wrote:
>> This patch is broken when we have:
>> (insn 8 7 14 2 ins-23.c:25 (set (zero_extract:SI (reg:SI 195 [ a ])
>> Â Â Â Â Â Â (const_int 8 [0x8])
>> Â Â Â Â Â Â (const_int 12 [0xc]))
>> Â Â Â Â (reg:SI 196)) 214 {insvsi} (expr_list:REG_EQUAL (const_int -1
>> [0xffffffffffffffff])
>> Â Â Â Â (nil)))
>>
>> It does the correct thing of replacing it with:
>> (set (reg:SI 195 [ a ])
>> Â Â (ior:SI (reg:SI 4 $4 [ a ])
>> Â Â Â Â (const_int 1044480 [0xff000])))
>> But then it does remove the reg_equal from the instruction which
>> causes us to get:
>> (set (reg/i:DI 2 $2)
>> Â Â (const_int -1 [0xffffffffffffffff]))
>
> Hi Andrew, thanks for testing and finding this. Do you have a testcase I
> can use?


It is hard to reproduce on the trunk as I have some changes in the
mips back-end.  Though we might get the same RTL doing something like:
struct a
{
  long long a:32;
  long long b:8;
  long long c:24;
};
struct a f(struct a a)
{
  a.b=-1;
  return a;
}

Thanks,
Andrew Pinski


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