Commit cf5124f6 by Roger Sayle Committed by Roger Sayle

re PR middle-end/6600 (i960 toolchain hits abort in c_readstr)


	PR middle-end/6600
	* expr.c (STORE_MAX_PIECES): New macro to avoid immediate constants
	larger than INTEGER_CST.  (store_by_pieces_1): Use it here...
	(can_store_by_pieces): ... and here to limit the largest mode used.
	Add a comment to document this function.

From-SVN: r53706
parent 380e6ade
2002-05-21 Roger Sayle <roger@eyesopen.com>
PR middle-end/6600
* expr.c (STORE_MAX_PIECES): New macro to avoid immediate constants
larger than INTEGER_CST. (store_by_pieces_1): Use it here...
(can_store_by_pieces): ... and here to limit the largest mode used.
Add a comment to document this function.
2002-05-21 Richard Henderson <rth@redhat.com> 2002-05-21 Richard Henderson <rth@redhat.com>
* flow.c (life_analysis): Fix test for deleted label. * flow.c (life_analysis): Fix test for deleted label.
......
...@@ -1400,6 +1400,13 @@ convert_modes (mode, oldmode, x, unsignedp) ...@@ -1400,6 +1400,13 @@ convert_modes (mode, oldmode, x, unsignedp)
#define MOVE_MAX_PIECES MOVE_MAX #define MOVE_MAX_PIECES MOVE_MAX
#endif #endif
/* STORE_MAX_PIECES is the number of bytes at a time that we can
store efficiently. Due to internal GCC limitations, this is
MOVE_MAX_PIECES limited by the number of bytes GCC can represent
for an immediate constant. */
#define STORE_MAX_PIECES MIN (MOVE_MAX_PIECES, 2 * sizeof (HOST_WIDE_INT))
/* Generate several move instructions to copy LEN bytes from block FROM to /* Generate several move instructions to copy LEN bytes from block FROM to
block TO. (These are MEM rtx's with BLKmode). The caller must pass FROM block TO. (These are MEM rtx's with BLKmode). The caller must pass FROM
and TO through protect_from_queue before calling. and TO through protect_from_queue before calling.
...@@ -2331,6 +2338,12 @@ use_group_regs (call_fusage, regs) ...@@ -2331,6 +2338,12 @@ use_group_regs (call_fusage, regs)
} }
/* Determine whether the LEN bytes generated by CONSTFUN can be
stored to memory using several move instructions. CONSTFUNDATA is
a pointer which will be passed as argument in every CONSTFUN call.
ALIGN is maximum alignment we can assume. Return nonzero if a
call to store_by_pieces should succeed. */
int int
can_store_by_pieces (len, constfun, constfundata, align) can_store_by_pieces (len, constfun, constfundata, align)
unsigned HOST_WIDE_INT len; unsigned HOST_WIDE_INT len;
...@@ -2361,7 +2374,7 @@ can_store_by_pieces (len, constfun, constfundata, align) ...@@ -2361,7 +2374,7 @@ can_store_by_pieces (len, constfun, constfundata, align)
{ {
l = len; l = len;
mode = VOIDmode; mode = VOIDmode;
max_size = MOVE_MAX_PIECES + 1; max_size = STORE_MAX_PIECES + 1;
while (max_size > 1) while (max_size > 1)
{ {
for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT); for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
...@@ -2472,7 +2485,7 @@ store_by_pieces_1 (data, align) ...@@ -2472,7 +2485,7 @@ store_by_pieces_1 (data, align)
unsigned int align; unsigned int align;
{ {
rtx to_addr = XEXP (data->to, 0); rtx to_addr = XEXP (data->to, 0);
unsigned HOST_WIDE_INT max_size = MOVE_MAX_PIECES + 1; unsigned HOST_WIDE_INT max_size = STORE_MAX_PIECES + 1;
enum machine_mode mode = VOIDmode, tmode; enum machine_mode mode = VOIDmode, tmode;
enum insn_code icode; enum insn_code icode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment