This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix enable checking failure in pa.c
- From: Roger Sayle <roger at eyesopen dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Tue, 27 Jan 2004 16:12:22 -0700 (MST)
- Subject: [PATCH] Fix enable checking failure in pa.c
The following patch resolves a recent enable checking regression on
hppa2.0w-hp-hpux11.00. It's possible in config/pa/pa.c's function
"emit_move_sequence" that we'd call INTVAL on a non-CONST_INT tree node.
This is mostly harmless, as the returned value in only ever used if
the node is actually a CONST_INT, but it trips up "tree" checking.
The patch below fixes this by adding a check that operand1 is a
CONST_INT before using INTVAL.
An enable-checking bootstrap on hppa2.0w-hp-hpux11.00 still fails
later due to garbage collection of trees that I've been unable to
track down. However, the following patch has been tested with a
non-enable-checking bootstrap on hppa2.0w-hp-hpux11.00, all default
languages, and tested with a top-level "make -k check" with no new
failures.
Ok for mainline?
2004-01-26 Roger Sayle <roger@eyesopen.com>
* config/pa/pa.c (emit_move_sequence): Check that operand1 is a
CONST_INT before using INTVAL.
Index: config/pa/pa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.237
diff -c -3 -p -r1.237 pa.c
*** config/pa/pa.c 20 Jan 2004 22:20:05 -0000 1.237
--- config/pa/pa.c 27 Jan 2004 02:57:06 -0000
*************** emit_move_sequence (rtx *operands, enum
*** 1975,1983 ****
{
rtx insn, temp;
rtx op1 = operand1;
! HOST_WIDE_INT value = INTVAL (operand1);
HOST_WIDE_INT insv = 0;
int insert = 0;
if (TARGET_64BIT
&& GET_CODE (operand1) == CONST_INT
--- 1975,1986 ----
{
rtx insn, temp;
rtx op1 = operand1;
! HOST_WIDE_INT value = 0;
HOST_WIDE_INT insv = 0;
int insert = 0;
+
+ if (GET_CODE (operand1) == CONST_INT)
+ value = INTVAL (operand1);
if (TARGET_64BIT
&& GET_CODE (operand1) == CONST_INT
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833