]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2012-10-16 Tom de Vries <tom@codesourcery.com>
authorTom de Vries <tom@codesourcery.com>
Tue, 16 Oct 2012 20:32:45 +0000 (20:32 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Tue, 16 Oct 2012 20:32:45 +0000 (20:32 +0000)
* expr.c (move_by_pieces, move_by_pieces_ninsns, can_store_by_pieces)
(store_by_pieces_1): Don't enter loop when no more data is left.

From-SVN: r192514

gcc/ChangeLog
gcc/expr.c

index 0b14270ee51215e08de9b65db261039f980b9278..14b817d840c4a4e0b9fb788907277e3ba2a79c27 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-16  Tom de Vries  <tom@codesourcery.com>
+
+       * expr.c (move_by_pieces, move_by_pieces_ninsns, can_store_by_pieces)
+       (store_by_pieces_1): Don't enter loop when no more data is left.
+
 2012-10-16  Joern Rennecke  <joern.rennecke@embecosm.com>
 
        * loop-doloop.c (doloop_modify): Pass doloop_end pattern to
index 3043176364954ccdc38d5818199dbbd6d7507354..8fa19fd5ce131394bbf3a8cab5dd326d77d8d9e0 100644 (file)
@@ -966,7 +966,7 @@ move_by_pieces (rtx to, rtx from, unsigned HOST_WIDE_INT len,
   /* First move what we can in the largest integer mode, then go to
      successively smaller modes.  */
 
-  while (max_size > 1)
+  while (max_size > 1 && data.len > 0)
     {
       enum machine_mode mode = widest_int_mode_for_size (max_size);
 
@@ -1026,7 +1026,7 @@ move_by_pieces_ninsns (unsigned HOST_WIDE_INT l, unsigned int align,
 
   align = alignment_for_piecewise_move (MOVE_MAX_PIECES, align);
 
-  while (max_size > 1)
+  while (max_size > 1 && l > 0)
     {
       enum machine_mode mode;
       enum insn_code icode;
@@ -2417,7 +2417,7 @@ can_store_by_pieces (unsigned HOST_WIDE_INT len,
     {
       l = len;
       max_size = STORE_MAX_PIECES + 1;
-      while (max_size > 1)
+      while (max_size > 1 && l > 0)
        {
          mode = widest_int_mode_for_size (max_size);
 
@@ -2612,7 +2612,7 @@ store_by_pieces_1 (struct store_by_pieces_d *data ATTRIBUTE_UNUSED,
   /* First store what we can in the largest integer mode, then go to
      successively smaller modes.  */
 
-  while (max_size > 1)
+  while (max_size > 1 && data->len > 0)
     {
       enum machine_mode mode = widest_int_mode_for_size (max_size);