This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to equiv_constant in cse.c
- To: egcs-patches at cygnus dot com
- Subject: Patch to equiv_constant in cse.c
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Mon, 12 Oct 1998 11:27:36 -0700
Hi,
I would like to submit the enclosed patch to cse.c. The patch fixes
a problem for the m32r toolchain when equiv_constant() calls
gen_lowpart_if_possible() which then returns NULL. Without this patch
the code does not check for a NULL value.
Cheers
Nick
Mon Oct 12 11:25:26 1998 Nick Clifton <nickc@cygnus.com>
* cse.c (equiv_constant): Check for NULL return from
gen_lowpart_if_possible().
Index: cse.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cse.c,v
retrieving revision 1.48
diff -p -w -r1.48 cse.c
*** cse.c 1998/10/06 12:04:55 1.48
--- cse.c 1998/10/12 18:26:39
*************** equiv_constant (x)
*** 5860,5866 ****
&& qty_const[reg_qty[REGNO (x)]])
x = gen_lowpart_if_possible (GET_MODE (x), qty_const[reg_qty[REGNO (x)]]);
! if (x != 0 && CONSTANT_P (x))
return x;
/* If X is a MEM, try to fold it outside the context of any insn to see if
--- 5860,5866 ----
&& qty_const[reg_qty[REGNO (x)]])
x = gen_lowpart_if_possible (GET_MODE (x), qty_const[reg_qty[REGNO (x)]]);
! if (x == 0 || CONSTANT_P (x))
return x;
/* If X is a MEM, try to fold it outside the context of any insn to see if