]> gcc.gnu.org Git - gcc.git/commitdiff
Update alignment_for_piecewise_move
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 30 Apr 2021 11:36:36 +0000 (04:36 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 30 Apr 2021 11:36:36 +0000 (04:36 -0700)
alignment_for_piecewise_move is called only with MOVE_MAX_PIECES or
STORE_MAX_PIECES, which are the number of bytes at a time that we
can move or store efficiently.  We should call mode_for_size without
limit to MAX_FIXED_MODE_SIZE, which is an integer expression for the
size in bits of the largest integer machine mode that should actually
be used, may be smaller than MOVE_MAX_PIECES or STORE_MAX_PIECES, which
may use vector.

* expr.c (alignment_for_piecewise_move): Call mode_for_size
without limit to MAX_FIXED_MODE_SIZE.

gcc/expr.c

index e0167b77410588df875011978eb974b52b0cae0b..b4c110f8c1795f1112cd1ebe5f3d5e7872ff7d1f 100644 (file)
@@ -746,7 +746,7 @@ static unsigned int
 alignment_for_piecewise_move (unsigned int max_pieces, unsigned int align)
 {
   scalar_int_mode tmode
-    = int_mode_for_size (max_pieces * BITS_PER_UNIT, 1).require ();
+    = int_mode_for_size (max_pieces * BITS_PER_UNIT, 0).require ();
 
   if (align >= GET_MODE_ALIGNMENT (tmode))
     align = GET_MODE_ALIGNMENT (tmode);
This page took 0.070139 seconds and 5 git commands to generate.