The following patch fixes

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65407

The patch was bootstrapped and tested on x86/x86-64, ppc64, aarch64.

Committed as rev. 221734.

2015-03-27  Vladimir Makarov  <vmaka...@redhat.com>

        PR target/65407
        * ira-costs.c (record_reg_classes): Process all constraint string
        containing 0-9.

2015-03-27  Vladimir Makarov  <vmaka...@redhat.com>

        PR target/65407
        * gcc.target/i386/avx512f-kandnw-1.c: Add scanning kmovw.


Index: ira-costs.c
===================================================================
--- ira-costs.c (revision 221669)
+++ ira-costs.c (working copy)
@@ -589,7 +589,7 @@ record_reg_classes (int n_alts, int n_op
          while (*p == '%' || *p == '=' || *p == '+' || *p == '&')
            p++;
 
-         if (p[0] >= '0' && p[0] <= '0' + i && (p[1] == ',' || p[1] == 0))
+         if (p[0] >= '0' && p[0] <= '0' + i)
            {
              /* Copy class and whether memory is allowed from the
                 matching alternative.  Then perform any needed cost
@@ -754,14 +754,7 @@ record_reg_classes (int n_alts, int n_op
                      && ! find_reg_note (insn, REG_DEAD, op))
                    alt_cost += 2;
 
-                 /* This is in place of ordinary cost computation for
-                    this operand, so skip to the end of the
-                    alternative (should be just one character).  */
-                 while (*p && *p++ != ',')
-                   ;
-
-                 constraints[i] = p;
-                 continue;
+                 p++;
                }
            }
 
Index: testsuite/gcc.target/i386/avx512f-kandnw-1.c
===================================================================
--- testsuite/gcc.target/i386/avx512f-kandnw-1.c        (revision 221669)
+++ testsuite/gcc.target/i386/avx512f-kandnw-1.c        (working copy)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-mavx512f -O2" } */
 /* { dg-final { scan-assembler-times "kandnw\[ 
\\t\]+\[^\{\n\]*%k\[0-7\](?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "kmovw" 2 } } */
 
 #include <immintrin.h>
 

Reply via email to