This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Three minor expr.c bugfixes


These are historically-unrelated minor bugfixes in expr.c.

Tested on i686-pc-linux-gnu.

Wed Oct 23 12:09:23 2002  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* expr.c (store_field): Don't clobber TEMP in shift: it might be
	a variable.
	(get_inner_reference): Don't go through a VIEW_CONVERT_EXPR
	whose purpose is to step up the alignment.
	(expand_expr, case ADDR_EXPR): Force LO_SUM into memory, just like REG.

*** gcc/expr.c	3 May 2003 14:30:07 -0000	1.534
--- gcc/expr.c	4 May 2003 22:08:13 -0000
*************** store_field (target, bitsize, bitpos, mo
*** 5649,5653 ****
  			     size_int (GET_MODE_BITSIZE (GET_MODE (temp))
  				       - bitsize),
! 			     temp, 1);
  
        /* Unless MODE is VOIDmode or BLKmode, convert TEMP to
--- 5649,5653 ----
  			     size_int (GET_MODE_BITSIZE (GET_MODE (temp))
  				       - bitsize),
! 			     NULL_RTX, 1);
  
        /* Unless MODE is VOIDmode or BLKmode, convert TEMP to
*************** get_inner_reference (exp, pbitsize, pbit
*** 5889,5894 ****
  	  continue;
  	}
        else if (TREE_CODE (exp) != NON_LVALUE_EXPR
! 	       && TREE_CODE (exp) != VIEW_CONVERT_EXPR
  	       && ! ((TREE_CODE (exp) == NOP_EXPR
  		      || TREE_CODE (exp) == CONVERT_EXPR)
--- 5889,5906 ----
  	  continue;
  	}
+ 
+       /* We can go inside most conversions: all NON_VALUE_EXPRs, all normal
+ 	 conversions that don't change the mode, and all view conversions
+ 	 except those that need to "step up" the alignment.  */
        else if (TREE_CODE (exp) != NON_LVALUE_EXPR
! 	       && ! (TREE_CODE (exp) == VIEW_CONVERT_EXPR
! 		     && ! ((TYPE_ALIGN (TREE_TYPE (exp))
! 			    > TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (exp, 0))))
! 			   && STRICT_ALIGNMENT
! 			   && (TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (exp, 0)))
! 			       < BIGGEST_ALIGNMENT)
! 			   && (TYPE_ALIGN_OK (TREE_TYPE (exp))
! 			       || TYPE_ALIGN_OK (TREE_TYPE
! 						 (TREE_OPERAND (exp, 0))))))
  	       && ! ((TREE_CODE (exp) == NOP_EXPR
  		      || TREE_CODE (exp) == CONVERT_EXPR)
*************** expand_expr (exp, target, tmode, modifie
*** 9246,9250 ****
  	  else if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG
  		   || GET_CODE (op0) == CONCAT || GET_CODE (op0) == ADDRESSOF
! 		   || GET_CODE (op0) == PARALLEL)
  	    {
  	      /* If the operand is a SAVE_EXPR, we can deal with this by
--- 9258,9262 ----
  	  else if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG
  		   || GET_CODE (op0) == CONCAT || GET_CODE (op0) == ADDRESSOF
! 		   || GET_CODE (op0) == PARALLEL || GET_CODE (op0) == LO_SUM)
  	    {
  	      /* If the operand is a SAVE_EXPR, we can deal with this by


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]