Propsed patch to cse.c

Nick Clifton nickc@cygnus.com
Tue Aug 25 15:01:00 GMT 1998


Hi,

  I would like to submit the enclosed patch for consideration.  It
prevents a segmentation faul when compiling
newlib/libc/stdlib/mallocr.c for the m32r toolchain, by allowing
equiv_constant() to cope with the call to gen_lowpart_if_possible()
returning 0.

Cheers
	Nick


Tue Aug 25 11:38:21 1998  Nick Clifton  <nickc@cygnus.com>

	* cse.c (equiv_constant): Cope with gen_lowpart_if_possible()
	returning 0.


Index: cse.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cse.c,v
retrieving revision 1.46
diff -p -w -r1.46 cse.c
*** cse.c	1998/08/14 16:28:29	1.46
--- cse.c	1998/08/25 21:59:27
*************** equiv_constant (x)
*** 5768,5774 ****
        && 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
--- 5768,5774 ----
        && 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



More information about the Gcc-patches mailing list