aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-04-30 04:36:36 -0700
committerH.J. Lu <hjl.tools@gmail.com>2021-04-30 04:36:36 -0700
commit18d713fbd345c5c54ab6091ac5f114df4551d1bb (patch)
treead63516e3ef82ea1329adf16830da03eed091363
parent86c77c52f7b812adccf9620860f7c392f9a16cfc (diff)
downloadgcc-18d713fbd345c5c54ab6091ac5f114df4551d1bb.zip
gcc-18d713fbd345c5c54ab6091ac5f114df4551d1bb.tar.gz
gcc-18d713fbd345c5c54ab6091ac5f114df4551d1bb.tar.bz2
Update alignment_for_piecewise_move
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.
-rw-r--r--gcc/expr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index e0167b7..b4c110f 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -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);