On Fri, Nov 18, 2016 at 09:30:06PM +0100, Jakub Jelinek wrote:
> On Fri, Nov 18, 2016 at 08:41:01PM +0100, Jakub Jelinek wrote:
> > I'm seeing lots of ICEs with this.
> 
> Here is untested fix for that, will bootstrap/regtest it soon (after my
> current set of bootstraps finishes).
> 
> 2016-11-18  Jakub Jelinek  <ja...@redhat.com>
> 
>       * config/i386/i386.c (ix86_expand_builtin): Remove msk_mov variable,
>       don't initialize it, don't use it for the case where it isn't
>       provable %{z} nor using the same argument, instead move merge
>       argument into a new pseudo and use that as target.  Formatting fixes.

Now successfully bootstrapped/regtested on x86_64-linux and i686-linux and
fixed a couple of FAILs, but not tons of others.

Here is another patch I'm going to test which fixes many other FAILs, but
still some are left:
FAIL: gcc.target/i386/funcspec-3.c (internal compiler error)
FAIL: gcc.target/i386/funcspec-3.c (test for excess errors)
FAIL: gcc.target/i386/mvc1.c (internal compiler error)
FAIL: gcc.target/i386/mvc1.c (test for excess errors)
FAIL: gcc.target/i386/mvc6.c (internal compiler error)
FAIL: gcc.target/i386/mvc6.c (test for excess errors)
FAIL: gcc.target/i386/mvc6.c scan-assembler vpshufb
FAIL: gcc.target/i386/mvc6.c scan-assembler punpcklbw
FAIL: gcc.target/i386/mvc8.c (internal compiler error)
FAIL: gcc.target/i386/mvc8.c (test for excess errors)
FAIL: gcc.target/i386/pr67995-2.c (internal compiler error)
FAIL: gcc.target/i386/pr67995-2.c (test for excess errors)
FAIL: gcc.target/i386/pr71652-3.c (internal compiler error)
FAIL: gcc.target/i386/pr71652-3.c  (test for errors, line 5)
FAIL: gcc.target/i386/pr71652-3.c (test for excess errors)
Will debug even those.

2016-11-19  Jakub Jelinek  <ja...@redhat.com>

        * config/i386/i386.c (def_builtin, def_builtin2, def_builtin_const2,
        ix86_add_new_builtins): Formatting fixes.
        (ix86_expand_builtin): Use || instead of && for isa vs. isa2.
        (ix86_get_builtin): Likewise.

--- gcc/config/i386/i386.c.jj   2016-11-18 22:30:16.000000000 +0100
+++ gcc/config/i386/i386.c      2016-11-19 08:37:45.748175866 +0100
@@ -30924,7 +30924,7 @@ def_builtin (HOST_WIDE_INT mask, const c
         means that *both* cpuid bits must be set for the built-in to be 
available.
         Handle this here.  */
       if (mask & ix86_isa_flags & OPTION_MASK_ISA_AVX512VL)
-         mask &= ~OPTION_MASK_ISA_AVX512VL;
+       mask &= ~OPTION_MASK_ISA_AVX512VL;
 
       mask &= ~OPTION_MASK_ISA_64BIT;
       if (mask == 0
@@ -30976,8 +30976,8 @@ def_builtin_const (HOST_WIDE_INT mask, c
 
 static inline tree
 def_builtin2 (HOST_WIDE_INT mask, const char *name,
-            enum ix86_builtin_func_type tcode,
-            enum ix86_builtins code)
+             enum ix86_builtin_func_type tcode,
+             enum ix86_builtins code)
 {
   tree decl = NULL_TREE;
 
@@ -30992,8 +30992,8 @@ def_builtin2 (HOST_WIDE_INT mask, const
       tree type = ix86_get_builtin_func_type (tcode);
       decl = add_builtin_function (name, type, code, BUILT_IN_MD,
                                   NULL, NULL_TREE);
-         ix86_builtins[(int) code] = decl;
-         ix86_builtins_isa[(int) code].set_and_not_built_p = false;
+      ix86_builtins[(int) code] = decl;
+      ix86_builtins_isa[(int) code].set_and_not_built_p = false;
     }
   else
     {
@@ -31016,7 +31016,7 @@ def_builtin2 (HOST_WIDE_INT mask, const
 
 static inline tree
 def_builtin_const2 (HOST_WIDE_INT mask, const char *name,
-                  enum ix86_builtin_func_type tcode, enum ix86_builtins code)
+                   enum ix86_builtin_func_type tcode, enum ix86_builtins code)
 {
   tree decl = def_builtin2 (mask, name, tcode, code);
   if (decl)
@@ -31034,8 +31034,8 @@ def_builtin_const2 (HOST_WIDE_INT mask,
 static void
 ix86_add_new_builtins (HOST_WIDE_INT isa, HOST_WIDE_INT isa2)
 {
-  if (((isa & deferred_isa_values) == 0)
-      && ((isa2 & deferred_isa_values2) == 0))
+  if ((isa & deferred_isa_values) == 0
+      && (isa2 & deferred_isa_values2) == 0)
     return;
 
   /* Bits in ISA value can be removed from potential isa values.  */
@@ -31048,7 +31048,8 @@ ix86_add_new_builtins (HOST_WIDE_INT isa
 
   for (i = 0; i < (int)IX86_BUILTIN_MAX; i++)
     {
-      if ((((ix86_builtins_isa[i].isa & isa) != 0) || 
((ix86_builtins_isa[i].isa2 & isa2) != 0))
+      if (((ix86_builtins_isa[i].isa & isa) != 0
+          || (ix86_builtins_isa[i].isa2 & isa2) != 0)
          && ix86_builtins_isa[i].set_and_not_built_p)
        {
          tree decl, type;
@@ -36549,7 +36550,7 @@ ix86_expand_builtin (tree exp, rtx targe
      whether it is supported.  */
   if ((ix86_builtins_isa[fcode].isa
        && !(ix86_builtins_isa[fcode].isa & ix86_isa_flags))
-      && (ix86_builtins_isa[fcode].isa2
+      || (ix86_builtins_isa[fcode].isa2
          && !(ix86_builtins_isa[fcode].isa2 & ix86_isa_flags2)))
     {
       char *opts = ix86_target_string (ix86_builtins_isa[fcode].isa,
@@ -38514,7 +38515,7 @@ static tree ix86_get_builtin (enum ix86_
   opts = TREE_TARGET_OPTION (target_tree);
 
   if ((ix86_builtins_isa[(int) code].isa & opts->x_ix86_isa_flags)
-       && (ix86_builtins_isa[(int) code].isa2 & opts->x_ix86_isa_flags2))
+      || (ix86_builtins_isa[(int) code].isa2 & opts->x_ix86_isa_flags2))
     return ix86_builtin_decl (code, true);
   else
     return NULL_TREE;


        Jakub

Reply via email to