diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-03-06 06:35:46 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-08-11 11:03:23 -0700 |
commit | d98fc614e852ae311ef5dde45013bb9413591354 (patch) | |
tree | bcd2960a4257fed022b89770f71d887806449e39 | |
parent | df15667f26a14a460916b047a19b3bcd99ffd557 (diff) | |
download | gcc-hjl/pr74113.tar.gz |
Don't limit piecewise move to MAX_FIXED_MODE_SIZEhjl/pr74113
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 register.
MAX_BITSIZE_MODE_ANY_INT is only defined for i386 and everyone else uses
the default. The widest mode for integer computation is determined by
MAX_FIXED_MODE_SIZE, not by MAX_BITSIZE_MODE_ANY_INT. OImode and XImode
can be used for load and store, including constant integers. Remove
MAX_BITSIZE_MODE_ANY_INT from i386 to avoid any potential problems for
constant integers > TImode.
PR middle-end/74113
* expr.c (alignment_for_piecewise_move): Call mode_for_size
without limit to MAX_FIXED_MODE_SIZE.
* config/i386/i386-modes.def (MAX_BITSIZE_MODE_ANY_INT): Removed.
-rw-r--r-- | gcc/config/i386/i386-modes.def | 5 | ||||
-rw-r--r-- | gcc/expr.c | 2 |
2 files changed, 1 insertions, 6 deletions
diff --git a/gcc/config/i386/i386-modes.def b/gcc/config/i386/i386-modes.def index d524313adc3..61a1f088291 100644 --- a/gcc/config/i386/i386-modes.def +++ b/gcc/config/i386/i386-modes.def @@ -98,10 +98,5 @@ POINTER_BOUNDS_MODE (BND64, 16); INT_MODE (OI, 32); INT_MODE (XI, 64); -/* Keep the OI and XI modes from confusing the compiler into thinking - that these modes could actually be used for computation. They are - only holders for vectors during data movement. */ -#define MAX_BITSIZE_MODE_ANY_INT (128) - /* The symbol Pmode stands for one of the above machine modes (usually SImode). The tm.h file specifies which one. It is not a distinct mode. */ diff --git a/gcc/expr.c b/gcc/expr.c index 46de35f2549..826fd9b1f89 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -692,7 +692,7 @@ alignment_for_piecewise_move (unsigned int max_pieces, unsigned int align) { machine_mode tmode; - tmode = mode_for_size (max_pieces * BITS_PER_UNIT, MODE_INT, 1); + tmode = mode_for_size (max_pieces * BITS_PER_UNIT, MODE_INT, 0); if (align >= GET_MODE_ALIGNMENT (tmode)) align = GET_MODE_ALIGNMENT (tmode); else |