This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
pa.c bugfix
- To: gcc-patches at gcc dot gnu dot org
- Subject: pa.c bugfix
- From: Jeffrey A Law <law at redhat dot com>
- Date: Thu, 01 Mar 2001 02:39:23 -0700
- Reply-To: law at redhat dot com
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