re PR rtl-optimization/91976 (RTL check: expected code 'const_int', have 'reg' in...
authorJakub Jelinek <jakub@redhat.com>
Wed, 2 Oct 2019 22:33:39 +0000 (00:33 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 2 Oct 2019 22:33:39 +0000 (00:33 +0200)
PR rtl-optimization/91976
* expr.c (emit_block_move_hints): Don't call can_move_by_pieces if
size is not CONST_INT_P, set pieces_ok to false in that case.  Simplify
CONST_INT_P (size) && pieces_ok to pieces_ok.  Formatting fix.

From-SVN: r276495

gcc/ChangeLog
gcc/expr.c

index 371e7bc13ddaec6f5188ff91303b120fa5e8e879..6aff2cd4371fff4ffa961b3bd09495f2602764e9 100644 (file)
@@ -1,3 +1,10 @@
+2019-10-03  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/91976
+       * expr.c (emit_block_move_hints): Don't call can_move_by_pieces if
+       size is not CONST_INT_P, set pieces_ok to false in that case.  Simplify
+       CONST_INT_P (size) && pieces_ok to pieces_ok.  Formatting fix.
+
 2019-10-02  Martin Sebor  <msebor@redhat.com>
 
        PR tree-optimization/80936
index bd6a71a4e2fde97c511a6827d39c6229bfb1cb60..c4210547aee66cd40523c08100c2ee491399ca1b 100644 (file)
@@ -1624,16 +1624,18 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method,
       set_mem_size (y, const_size);
     }
 
-  bool pieces_ok = can_move_by_pieces (INTVAL (size), align);
+  bool pieces_ok = false;
+  if (CONST_INT_P (size))
+    pieces_ok = can_move_by_pieces (INTVAL (size), align);
   bool pattern_ok = false;
 
-  if (!CONST_INT_P (size) || !pieces_ok || might_overlap)
+  if (!pieces_ok || might_overlap)
     {
-      pattern_ok = 
-       emit_block_move_via_pattern (x, y, size, align,
-                                    expected_align, expected_size,
-                                    min_size, max_size, probable_max_size,
-                                    might_overlap);
+      pattern_ok
+       emit_block_move_via_pattern (x, y, size, align,
+                                      expected_align, expected_size,
+                                      min_size, max_size, probable_max_size,
+                                      might_overlap);
       if (!pattern_ok && might_overlap)
        {
          /* Do not try any of the other methods below as they are not safe
@@ -1645,7 +1647,7 @@ emit_block_move_hints (rtx x, rtx y, rtx size, enum block_op_methods method,
 
   if (pattern_ok)
     ;
-  else if (CONST_INT_P (size) && pieces_ok)
+  else if (pieces_ok)
     move_by_pieces (x, y, INTVAL (size), align, RETURN_BEGIN);
   else if (may_use_call && !might_overlap
           && ADDR_SPACE_GENERIC_P (MEM_ADDR_SPACE (x))