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]

Remove obsolete test from stor-layout.c:choose_record_mode


The comment and code here is very obsolete.  extract_bit_field has been
able to handle this case since at least GCC 2.8.1 and probably well before.

Tested on i686-pc-linux-gnu.

2003-07-13  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* stor-layout.c (compute_record_mode): Remove very obsolete test
	that forces BLKmode for records with fields crossing word boundary.

*** stor-layout.c	6 Jul 2003 12:35:55 -0000	1.160
--- stor-layout.c	13 Jul 2003 17:04:52 -0000
*************** compute_record_mode (tree type)
*** 1311,1316 ****
    for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
      {
-       unsigned HOST_WIDE_INT bitpos;
- 
        if (TREE_CODE (field) != FIELD_DECL)
  	continue;
--- 1311,1314 ----
*************** compute_record_mode (tree type)
*** 1322,1338 ****
  	  || DECL_SIZE (field) == 0
  	  || ! host_integerp (DECL_SIZE (field), 1))
- 	return;
- 
-       bitpos = int_bit_position (field);
- 
-       /* Must be BLKmode if any field crosses a word boundary,
- 	 since extract_bit_field can't handle that in registers.  */
-       if (bitpos / BITS_PER_WORD
- 	  != ((tree_low_cst (DECL_SIZE (field), 1) + bitpos - 1)
- 	      / BITS_PER_WORD)
- 	  /* But there is no problem if the field is entire words
- 	     or bigger than a word.  */
- 	  && ! (tree_low_cst (DECL_SIZE (field), 1) % BITS_PER_WORD == 0
- 		|| compare_tree_int (DECL_SIZE (field), BITS_PER_WORD) > 0))
  	return;
  
--- 1320,1323 ----


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