re PR target/93174 (ICE building glibc __sha512_process_block for i686)
authorJakub Jelinek <jakub@redhat.com>
Wed, 8 Jan 2020 15:58:20 +0000 (16:58 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 8 Jan 2020 15:58:20 +0000 (16:58 +0100)
PR target/93174
* config/i386/i386.md (addcarry<mode>_0): Use nonimmediate_operand
predicate for output operand instead of register_operand.
(addcarry<mode>, addcarry<mode>_1): Likewise.  Add alternative with
memory destination and non-memory operands[2].

* gcc.c-torture/compile/pr93174.c: New test.

From-SVN: r280011

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr93174.c [new file with mode: 0644]

index f960eb4be6820e2187bcac3d024b0ee9954cbeba..cb1f7cb6dc31037197a9e13ba4399404b2c41c40 100644 (file)
@@ -1,3 +1,11 @@
+2020-01-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/93174
+       * config/i386/i386.md (addcarry<mode>_0): Use nonimmediate_operand
+       predicate for output operand instead of register_operand.
+       (addcarry<mode>, addcarry<mode>_1): Likewise.  Add alternative with
+       memory destination and non-memory operands[2].
+
 2020-01-08  Martin Liska  <mliska@suse.cz>
 
        * cgraph.c (cgraph_node::dump): Use ::dump_name or
index 50fb99ae594b4fdcb4c1b3ec46fcf249cafc4b33..3daf7205d91ad81642cc6dcb19ec8ebb8231d386 100644 (file)
              (plus:SWI48
                (match_operator:SWI48 5 "ix86_carry_flag_operator"
                  [(match_operand 3 "flags_reg_operand") (const_int 0)])
-               (match_operand:SWI48 1 "nonimmediate_operand" "%0"))
-             (match_operand:SWI48 2 "nonimmediate_operand" "rm")))
+               (match_operand:SWI48 1 "nonimmediate_operand" "%0,0"))
+             (match_operand:SWI48 2 "nonimmediate_operand" "r,rm")))
          (plus:<DWI>
            (zero_extend:<DWI> (match_dup 2))
            (match_operator:<DWI> 4 "ix86_carry_flag_operator"
              [(match_dup 3) (const_int 0)]))))
-   (set (match_operand:SWI48 0 "register_operand" "=r")
+   (set (match_operand:SWI48 0 "nonimmediate_operand" "=rm,r")
        (plus:SWI48 (plus:SWI48 (match_op_dup 5
                                 [(match_dup 3) (const_int 0)])
                                (match_dup 1))
               (match_operand:SWI48 1 "nonimmediate_operand")
               (match_operand:SWI48 2 "x86_64_general_operand"))
             (match_dup 1)))
-      (set (match_operand:SWI48 0 "register_operand")
+      (set (match_operand:SWI48 0 "nonimmediate_operand")
           (plus:SWI48 (match_dup 1) (match_dup 2)))])]
   "ix86_binary_operator_ok (PLUS, <MODE>mode, operands)")
 
            (match_operand:<DWI> 6 "const_scalar_int_operand" "")
            (match_operator:<DWI> 4 "ix86_carry_flag_operator"
              [(match_dup 3) (const_int 0)]))))
-   (set (match_operand:SWI48 0 "register_operand" "=r")
+   (set (match_operand:SWI48 0 "nonimmediate_operand" "=rm")
        (plus:SWI48 (plus:SWI48 (match_op_dup 5
                                 [(match_dup 3) (const_int 0)])
                                (match_dup 1))
index 63ba12d86862ccdfbc5236a23d39e1d30762382f..88708582afb2f166a590631456506b97c0a6c3c1 100644 (file)
@@ -1,3 +1,8 @@
+2020-01-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/93174
+       * gcc.c-torture/compile/pr93174.c: New test.
+
 2020-01-08  Olivier Hainque  <hainque@adacore.com>
             Alexandre Oliva  <oliva@adacore.com>
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr93174.c b/gcc/testsuite/gcc.c-torture/compile/pr93174.c
new file mode 100644 (file)
index 0000000..653a470
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR target/93174 */
+
+unsigned long long a[2];
+void bar (void);
+
+void
+foo (int c)
+{
+  int e = c >> 2;
+  a[0] += c;
+  a[1] = a[0] < c;
+  while (e--)
+    bar ();
+}