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  <car...@google.com>
+
+       PR rtl-optimization/49799
+       * combine.c (make_compound_operation): Check if the bit field is valid
+       before change it to bit field extraction.
+
 2011-07-29  Bernd Schmidt  <ber...@codesourcery.com>

        PR rtl-optimization/49891
Index: gcc/testsuite/gcc.dg/pr49799.c
===================================================================
--- gcc/testsuite/gcc.dg/pr49799.c      (revision 0)
+++ gcc/testsuite/gcc.dg/pr49799.c      (revision 0)
@@ -0,0 +1,25 @@
+/* PR rtl-optimization/49799 */
+/* { dg-do assemble } */
+/* { dg-options "-O2 -w" } */
+
+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;
+}
Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog     (revision 176910)
+++ gcc/testsuite/ChangeLog     (working copy)
@@ -1,3 +1,8 @@
+2011-07-29  Wei Guozhi  <car...@google.com>
+
+       PR rtl-optimization/49799
+       * gcc.dg/pr49799.c: New test case.
+
 2011-07-22  Sebastian Pop  <sebastian....@amd.com>

        PR middle-end/48648
Index: gcc/combine.c
===================================================================
--- gcc/combine.c       (revision 176910)
+++ 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);

thanks a lot.
Carrot

On Thu, Jul 28, 2011 at 4:47 PM, Jakub Jelinek <ja...@redhat.com> wrote:
> On Thu, Jul 28, 2011 at 04:40:53PM +0800, Carrot Wei wrote:
>> ChangeLog:
>> 2011-07-28  Wei Guozhi  <car...@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
>

Reply via email to