Fix ia64 compiler problem with gcc.c-torture/compile/920410-1.c.

* expmed.c (store_bit_field): If op0 and fieldmode are the same size,
	then store directly into op0.

From-SVN: r31903
This commit is contained in:
Jim Wilson 2000-02-10 21:09:52 +00:00 committed by Jim Wilson
parent c2939b5700
commit 5e4900c7f4
2 changed files with 30 additions and 29 deletions

View File

@ -1,5 +1,8 @@
Thu Feb 10 12:56:47 2000 Jim Wilson <wilson@cygnus.com> Thu Feb 10 12:56:47 2000 Jim Wilson <wilson@cygnus.com>
* expmed.c (store_bit_field): If op0 and fieldmode are the same size,
then store directly into op0.
* calls.c (expand_call): When emitting a NOTE_INSN_SETJMP, search for * calls.c (expand_call): When emitting a NOTE_INSN_SETJMP, search for
the CALL_INSN, and emit the note immediately after it. the CALL_INSN, and emit the note immediately after it.

View File

@ -291,16 +291,18 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
if (flag_force_mem) if (flag_force_mem)
value = force_not_mem (value); value = force_not_mem (value);
/* Note that the adjustment of BITPOS above has no effect on whether if ((GET_MODE_SIZE (fieldmode) >= UNITS_PER_WORD
BITPOS is 0 in a REG bigger than a word. */ || (GET_MODE_SIZE (GET_MODE (op0)) == GET_MODE_SIZE (fieldmode)
if (GET_MODE_SIZE (fieldmode) >= UNITS_PER_WORD && GET_MODE_SIZE (fieldmode) != 0))
&& (GET_CODE (op0) != MEM && (GET_CODE (op0) != MEM
|| ! SLOW_UNALIGNED_ACCESS (fieldmode, align) || ! SLOW_UNALIGNED_ACCESS (fieldmode, align)
|| (offset * BITS_PER_UNIT % bitsize == 0 || (offset * BITS_PER_UNIT % bitsize == 0
&& align % GET_MODE_SIZE (fieldmode) == 0)) && align % GET_MODE_SIZE (fieldmode) == 0))
&& bitpos == 0 && bitsize == GET_MODE_BITSIZE (fieldmode)) && (BYTES_BIG_ENDIAN ? bitpos + bitsize == unit : bitpos == 0)
&& bitsize == GET_MODE_BITSIZE (fieldmode))
{ {
/* Storing in a full-word or multi-word field in a register /* Storing in a full-word or multi-word field in a register
can be done with just SUBREG. Also, storing in the entire object
can be done with just SUBREG. */ can be done with just SUBREG. */
if (GET_MODE (op0) != fieldmode) if (GET_MODE (op0) != fieldmode)
{ {
@ -332,10 +334,11 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
if (GET_CODE (op0) != MEM if (GET_CODE (op0) != MEM
&& (BYTES_BIG_ENDIAN ? bitpos + bitsize == unit : bitpos == 0) && (BYTES_BIG_ENDIAN ? bitpos + bitsize == unit : bitpos == 0)
&& bitsize == GET_MODE_BITSIZE (fieldmode) && bitsize == GET_MODE_BITSIZE (fieldmode)
&& (GET_MODE (op0) == fieldmode && (movstrict_optab->handlers[(int) fieldmode].insn_code
|| (movstrict_optab->handlers[(int) fieldmode].insn_code != CODE_FOR_nothing))
!= CODE_FOR_nothing)))
{ {
int icode = movstrict_optab->handlers[(int) fieldmode].insn_code;
/* Get appropriate low part of the value being stored. */ /* Get appropriate low part of the value being stored. */
if (GET_CODE (value) == CONST_INT || GET_CODE (value) == REG) if (GET_CODE (value) == CONST_INT || GET_CODE (value) == REG)
value = gen_lowpart (fieldmode, value); value = gen_lowpart (fieldmode, value);
@ -344,30 +347,25 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size)
|| GET_CODE (value) == CONST)) || GET_CODE (value) == CONST))
value = convert_to_mode (fieldmode, value, 0); value = convert_to_mode (fieldmode, value, 0);
if (GET_MODE (op0) == fieldmode) if (! (*insn_data[icode].operand[1].predicate) (value, fieldmode))
emit_move_insn (op0, value); value = copy_to_mode_reg (fieldmode, value);
else
if (GET_CODE (op0) == SUBREG)
{ {
int icode = movstrict_optab->handlers[(int) fieldmode].insn_code; if (GET_MODE (SUBREG_REG (op0)) == fieldmode
if (! (*insn_data[icode].operand[1].predicate) (value, fieldmode)) || GET_MODE_CLASS (fieldmode) == MODE_INT
value = copy_to_mode_reg (fieldmode, value); || GET_MODE_CLASS (fieldmode) == MODE_PARTIAL_INT)
op0 = SUBREG_REG (op0);
if (GET_CODE (op0) == SUBREG) else
{ /* Else we've got some float mode source being extracted into
if (GET_MODE (SUBREG_REG (op0)) == fieldmode a different float mode destination -- this combination of
|| GET_MODE_CLASS (fieldmode) == MODE_INT subregs results in Severe Tire Damage. */
|| GET_MODE_CLASS (fieldmode) == MODE_PARTIAL_INT) abort ();
op0 = SUBREG_REG (op0);
else
/* Else we've got some float mode source being extracted into
a different float mode destination -- this combination of
subregs results in Severe Tire Damage. */
abort ();
}
emit_insn (GEN_FCN (icode)
(gen_rtx_SUBREG (fieldmode, op0, offset), value));
} }
emit_insn (GEN_FCN (icode)
(gen_rtx_SUBREG (fieldmode, op0, offset), value));
return value; return value;
} }