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]

Minor nit in expand_expr case COMPONENT_REF


If we are hoping to get an address, not generate code, what we care
about is whether unaligned references *work*, not if they are
*efficient*.  If we don't do this, we may try to generate code when
writing static initializers.  I suspect this may only occur with
ARRAY_RANGE_REF since the test case (in Ada) used it.

Tested on alphaev56-dec-osf4.0f.

Fri Jul  4 17:27:21 2003  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* expr.c (expand_expr, case COMPONENT_REF): When seeing if should use 
	bitfield operations, use STRICT_ALIGNMENT, not SLOW_UNALIGNED_ACCESS
	if EXPAND_CONST_ADDRESS or EXPAND_INITIALIZER.

*** expr.c	4 Jul 2003 22:00:18 -0000	1.562
--- expr.c	5 Jul 2003 11:50:26 -0000
*************** expand_expr (tree exp, rtx target, enum 
*** 7542,7546 ****
  		&& (((TYPE_ALIGN (TREE_TYPE (tem)) < GET_MODE_ALIGNMENT (mode)
  		      || (bitpos % GET_MODE_ALIGNMENT (mode) != 0))
! 		     && SLOW_UNALIGNED_ACCESS (mode1, MEM_ALIGN (op0)))
  		    || (bitpos % BITS_PER_UNIT != 0)))
  	    /* If the type and the field are a constant size and the
--- 7542,7549 ----
  		&& (((TYPE_ALIGN (TREE_TYPE (tem)) < GET_MODE_ALIGNMENT (mode)
  		      || (bitpos % GET_MODE_ALIGNMENT (mode) != 0))
! 		     && ((modifier == EXPAND_CONST_ADDRESS
! 			  || modifier == EXPAND_INITIALIZER)
! 			 ? STRICT_ALIGNMENT
! 			 : SLOW_UNALIGNED_ACCESS (mode1, MEM_ALIGN (op0))))
  		    || (bitpos % BITS_PER_UNIT != 0)))
  	    /* If the type and the field are a constant size and the


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