Message ID | CAEe8uECJSOzSpmJcCw1WK_P0Ae=_zFunT6_75d0HCf2Ct_uyLA@mail.gmail.com |
---|---|
State | New |
Headers | show |
On Thu, Jul 28, 2011 at 04:40:53PM +0800, Carrot Wei wrote: > ChangeLog: > 2011-07-28 Wei Guozhi <carrot@google.com> > > 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/arm/pr49799.c, or better gcc.dg/pr49799.c. Putting the testcase just into gcc.target/arm means it won't be tested on other targets, while there is nothing arm specific about the testcase except that you force -march in dg-options for arm. You can do that with /* PR rtl-optimization/49799 */ /* { dg-do assemble } */ /* { dg-options "-O2 -w" } */ /* { dg-options "-O2 -w -march=armv7-a" { target arm*-*-* } } */ or similar. Ok with those changes. Jakub
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=armv7-a" } */ No, don't force the architecture like this. Just let multilib variant handling deal with it. Once you've done that, then this test isn't cpu specific and can be moved to c-torture/compile. R.
Index: gcc/combine.c =================================================================== --- gcc/combine.c (revision 176733) +++ gcc/combine.c (working copy) @@ -7787,6 +7787,7 @@ make_compound_operation (rtx x, enum rtx && GET_CODE (lhs) == ASHIFT && CONST_INT_P (XEXP (lhs, 1)) && INTVAL (rhs) >= INTVAL (XEXP (lhs, 1)) + && INTVAL (XEXP (lhs, 1)) >= 0 && INTVAL (rhs) < mode_width) { new_rtx = make_compound_operation (XEXP (lhs, 0), next_code); 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=armv7-a" } */ + +static __inline int bar(int a) +{ + int tmp; + + if (a <= 0) a ^= 0xFFFFFFFF; + + return tmp - 1; +} + +void foo(short *K) +{ + short tmp; + short *pptr, P[14]; + + pptr = P; + tmp = bar(*K); + *pptr = (*K << tmp) >> 16; + + if (*P < tmp) + *K++ = 0; +}