Re: [PATCH] PR49799: Don't generate illegal bit field extraction instruction

2011-07-28 Thread Carrot Wei
According to Richard, -march=armv7-a is not required. So the finally installed is: Index: gcc/ChangeLog === --- gcc/ChangeLog (revision 176910) +++ gcc/ChangeLog (working copy) @@ -1,3 +1,9 @@ +2011-07-29 Wei Guozhi +

Re: [PATCH] PR49799: Don't generate illegal bit field extraction instruction

2011-07-28 Thread Richard Earnshaw
On 28/07/11 09:40, Carrot Wei wrote: > Index: pr49799.c > === > --- pr49799.c (revision 0) > +++ pr49799.c (revision 0) > @@ -0,0 +1,25 @@ > +/* PR rtl-optimization/49799 */ > +/* { dg-do assemble } */ > +/* { dg-options "-O2 -w -march

Re: [PATCH] PR49799: Don't generate illegal bit field extraction instruction

2011-07-28 Thread Jakub Jelinek
On Thu, Jul 28, 2011 at 04:40:53PM +0800, Carrot Wei wrote: > ChangeLog: > 2011-07-28 Wei Guozhi > > PR rtl-optimization/49799 > * pr49799.c : New test case. Space shouldn't be between .c and :. And the filename should be relative to gcc/testsuite/ dir, so either gcc.target/ar

Re: [PATCH] PR49799: Don't generate illegal bit field extraction instruction

2011-07-28 Thread Carrot Wei
Test case added. Tested with make check-gcc RUNTESTFLAGS="--target_board=arm-sim/thumb/arch=armv7-a arm.exp=pr49799.c" make check-gcc RUNTESTFLAGS="--target_board=arm-sim/arch=armv7-a arm.exp=pr49799.c" It fails without this patch and passes with this patch. OK for trunk and 4.6 now? thanks Car

Re: [PATCH] PR49799: Don't generate illegal bit field extraction instruction

2011-07-28 Thread Jakub Jelinek
On Thu, Jul 28, 2011 at 03:38:07PM +0800, Carrot Wei wrote: > OK for trunk and 4.6? > > ChangeLog: > 2011-07-28 Wei Guozhi > > PR rtl-optimization/49799 > * combine.c (make_compound_operation): Check if the bit field is valid > before change it to bit field extraction.

[PATCH] PR49799: Don't generate illegal bit field extraction instruction

2011-07-28 Thread Carrot Wei
Hi In function combine.c:make_compound_operation, it tries to transforms the expression (ashiftrt (ashift foo C1) C2) with C2 >= C1 into SIGN_EXTRACT. It works pretty well in usual cases. But for the test case in PR49799, there is an expression (X << (tmp-1)) >> 16 tmp is an uninitializ