emit-rtl.c patch

John Carr jfc@mit.edu
Thu Apr 16 16:34:00 GMT 1998


This fixes a problem exposed by my SPARC patches: the 64 bit SPARC v9
floating point registers can not be accessed in SImode, so if an asm
statement forces a long long variable there the compiler will crash
if it tries to access a single word of the register.

	* emit-rtl.c (operand_subword_force): If a register can not be
	accessed by words, copy it to a pseudo register.

*** emit-rtl.c	1998/04/15 00:26:35	1.25
--- emit-rtl.c	1998/04/16 21:15:04
*************** operand_subword_force (op, i, mode)
*** 1380,1386 ****
      return result;
  
    if (mode != BLKmode && mode != VOIDmode)
!     op = force_reg (mode, op);
  
    result = operand_subword (op, i, 1, mode);
    if (result == 0)
--- 1380,1391 ----
      return result;
  
    if (mode != BLKmode && mode != VOIDmode)
!     /* If this is a register which can not be accessed by words, copy it
!        to a pseudo register.  */
!     if (GET_CODE (op) == REG)
!       op = copy_to_reg (op);
!     else
!       op = force_reg (mode, op);
  
    result = operand_subword (op, i, 1, mode);
    if (result == 0)



More information about the Gcc mailing list