patch to change STRUCT_FORCE_BLK to MEMBER_TYPE_FORCES_BLK applied

Joern Rennecke amylaar@cambridge.redhat.com
Fri Mar 2 19:55:00 GMT 2001


Approved by Jeffrey Law.

Sat Mar  3 03:46:47 2001  J"orn Rennecke <amylaar@redhat.com>

	* tm.texi: Change STRUCT_FORCE_BLK to MEMBER_TYPE_FORCES_BLK.
	* config/c4x/c4x.h: Likewise.
	* stor-layout.c (compute_record_mode): Likewise.
	(layout_type, case ARRAY_TYPE): Use MEMBER_TYPE_FORCES_BLK.

Index: stor-layout.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/stor-layout.c,v
retrieving revision 1.94
diff -p -r1.94 stor-layout.c
*** stor-layout.c	2001/02/14 07:57:48	1.94
--- stor-layout.c	2001/03/03 03:48:39
*************** compute_record_mode (type)
*** 1111,1122 ****
        if (simple_cst_equal (TYPE_SIZE (type), DECL_SIZE (field)))
  	mode = DECL_MODE (field);
  
! #ifdef STRUCT_FORCE_BLK
        /* With some targets, eg. c4x, it is sub-optimal
  	 to access an aligned BLKmode structure as a scalar.  */
!       if (mode == VOIDmode && STRUCT_FORCE_BLK (field))
  	return;
! #endif /* STRUCT_FORCE_BLK  */
      }
  
    /* If we only have one real field; use its mode.  This only applies to
--- 1111,1122 ----
        if (simple_cst_equal (TYPE_SIZE (type), DECL_SIZE (field)))
  	mode = DECL_MODE (field);
  
! #ifdef MEMBER_TYPE_FORCES_BLK
        /* With some targets, eg. c4x, it is sub-optimal
  	 to access an aligned BLKmode structure as a scalar.  */
!       if (mode == VOIDmode && MEMBER_TYPE_FORCES_BLK (field))
  	return;
! #endif /* MEMBER_TYPE_FORCES_BLK  */
      }
  
    /* If we only have one real field; use its mode.  This only applies to
*************** layout_type (type)
*** 1450,1455 ****
--- 1450,1458 ----
  
  	TYPE_MODE (type) = BLKmode;
  	if (TYPE_SIZE (type) != 0
+ #ifdef MEMBER_TYPE_FORCES_BLK
+ 	    && ! MEMBER_TYPE_FORCES_BLK (type)
+ #endif
  	    /* BLKmode elements force BLKmode aggregate;
  	       else extract/store fields may lose.  */
  	    && (TYPE_MODE (TREE_TYPE (type)) != BLKmode
Index: tm.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tm.texi,v
retrieving revision 1.174
diff -p -r1.174 tm.texi
*** tm.texi	2001/03/03 02:44:19	1.174
--- tm.texi	2001/03/03 03:48:44
*************** get from @code{PCC_BITFIELD_TYPE_MATTERS
*** 1118,1126 ****
  Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to
  aligning a bitfield within the structure.
  
! @findex STRUCT_FORCE_BLK
! @item STRUCT_FORCE_BLK (@var{field})
! Return 1 if a structure containing @var{field} should be accessed using
  @code{BLKMODE}.
  
  Normally, this is not needed.  See the file @file{c4x.h} for an example
--- 1118,1126 ----
  Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to
  aligning a bitfield within the structure.
  
! @findex MEMBER_TYPE_FORCES_BLK
! @item MEMBER_TYPE_FORCES_BLK (@var{field})
! Return 1 if a structure or array containing @var{field} should be accessed using
  @code{BLKMODE}.
  
  Normally, this is not needed.  See the file @file{c4x.h} for an example
Index: config/c4x/c4x.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/c4x/c4x.h,v
retrieving revision 1.71
diff -p -r1.71 c4x.h
*** c4x.h	2001/02/28 16:24:00	1.71
--- c4x.h	2001/03/03 03:48:45
*************** extern const char *c4x_rpts_cycles_strin
*** 370,376 ****
  
  /* If a structure has a floating point field then force structure
     to have BLKMODE.  */
! #define STRUCT_FORCE_BLK(FIELD) (TREE_CODE (TREE_TYPE (FIELD)) == REAL_TYPE)
  
  /* Number of bits in the high and low parts of a two stage
     load of an immediate constant.  */
--- 370,377 ----
  
  /* If a structure has a floating point field then force structure
     to have BLKMODE.  */
! #define MEMBER_TYPE_FORCES_BLK(FIELD) \
!   (TREE_CODE (TREE_TYPE (FIELD)) == REAL_TYPE)
  
  /* Number of bits in the high and low parts of a two stage
     load of an immediate constant.  */



More information about the Gcc-patches mailing list