[gnu.gcc.bug] find_reloads forces consts to mem with wrong mode

cudcv@warwick.ac.uk (Rob McMahon) (09/26/88)

GCC 1.28, Gould PN6000

When find_reloads calls force_const_mem to change an integer constant into a
memory reference, it uses the mode of the constant, which is usually VOIDmode,
rather than the mode the instruction wants.  As a result the memory reference
points to the wrong part of the constant.

This seems to fix the problem:

RCS file: reload.c,v
retrieving revision 1.9.1.2
diff -c -r1.9.1.2 reload.c
*** /tmp/,RCSt1a03369	Sun Sep 25 19:28:12 1988
--- reload.c	Sun Sep 25 00:55:19 1988
***************
*** 1539,1545 ****
  				    (enum reg_class) goal_alternative[i])
  	    == NO_REGS))
        {
! 	enum machine_mode mode = GET_MODE (recog_operand[i]);
  	*recog_operand_loc[i] = recog_operand[i]
  	  = (GET_CODE (recog_operand[i]) == CONST_DOUBLE
  	     ? force_const_double_mem (recog_operand[i])
--- 1539,1545 ----
  				    (enum reg_class) goal_alternative[i])
  	    == NO_REGS))
        {
! 	enum machine_mode mode = operand_mode[i];
  	*recog_operand_loc[i] = recog_operand[i]
  	  = (GET_CODE (recog_operand[i]) == CONST_DOUBLE
  	     ? force_const_double_mem (recog_operand[i])

Rob
-- 
UUCP:   ...!mcvax!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv@uk.ac.warwick             ARPA:   cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England