This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

pa.c bugfix



This fixes the -O0 -fPIC problem John David Anglin posted an analysis for
recently.  In simplest terms, we applied REGNO_REG_CLASS to a pseudo which
gave us, err, interesting results.  That resulted in us taking an
unexpected path in emit_move_sequence and do bad things.

	* pa.c (emit_move_sequence): Verify operand0 is a hard register
	before determining its register class.

Index: pa.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/pa/pa.c,v
retrieving revision 1.93.2.5
diff -c -3 -p -r1.93.2.5 pa.c
*** pa.c	2001/02/27 23:44:27	1.93.2.5
--- pa.c	2001/03/01 16:40:30
*************** emit_move_sequence (operands, mode, scra
*** 1336,1343 ****
        return 1;
      }
    /* Handle secondary reloads for SAR.  These occur when trying to load
!      the SAR from memory a FP register, or with a constant.  */
    else if (GET_CODE (operand0) == REG
  	   && REGNO_REG_CLASS (REGNO (operand0)) == SHIFT_REGS
  	   && (GET_CODE (operand1) == MEM
  	       || GET_CODE (operand1) == CONST_INT
--- 1336,1344 ----
        return 1;
      }
    /* Handle secondary reloads for SAR.  These occur when trying to load
!      the SAR from memory, FP register, or with a constant.  */
    else if (GET_CODE (operand0) == REG
+ 	   && REGNO (operand0) < FIRST_PSEUDO_REGISTER
  	   && REGNO_REG_CLASS (REGNO (operand0)) == SHIFT_REGS
  	   && (GET_CODE (operand1) == MEM
  	       || GET_CODE (operand1) == CONST_INT





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]