PATCH for fold-const.c: take 2

Mark Mitchell mark@markmitchell.com
Thu Jun 25 13:34:00 GMT 1998


The patch I just sent was written while I was under an evil influence,
and is total garbage.

Here's a better version.

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com

Thu Jun 25 12:47:41 1998  Mark Mitchell  <mark@markmitchell.com>

	* fold-const.c (make_range): Don't go looking at TREE_OPERANDs of
	nodes that are not expressions.

Index: fold-const.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fold-const.c,v
retrieving revision 1.40
diff -c -p -r1.40 fold-const.c
*** fold-const.c	1998/06/19 01:46:50	1.40
--- fold-const.c	1998/06/25 20:29:51
*************** make_range (exp, pin_p, plow, phigh)
*** 2836,2845 ****
    while (1)
      {
        code = TREE_CODE (exp);
!       arg0 = TREE_OPERAND (exp, 0), arg1 = TREE_OPERAND (exp, 1);
!       if (TREE_CODE_CLASS (code) == '<' || TREE_CODE_CLASS (code) == '1'
! 	  || TREE_CODE_CLASS (code) == '2')
! 	type = TREE_TYPE (arg0);
  
        switch (code)
  	{
--- 2836,2852 ----
    while (1)
      {
        code = TREE_CODE (exp);
! 
!       if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
! 	{
! 	  arg0 = TREE_OPERAND (exp, 0);
! 	  type = TREE_TYPE (arg0);
! 	  if (TREE_CODE_CLASS (code) == '2' 
! 	      || TREE_CODE_CLASS (code) == '<'
! 	      || (TREE_CODE_CLASS (code) == 'e' 
! 		  && tree_code_length[(int) code] > 1))
! 	    arg1 = TREE_OPERAND (exp, 1);
! 	}
  
        switch (code)
  	{



More information about the Gcc-patches mailing list