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]

Relax restriction slightly on integral mode structs


We can allow non-BLKmode RECORD_TYPEs even if a field crosses a word
boundary if that field is larger than a word since we have code to handle
that case.

Tested on i686-pc-linux-gnu.

Tue Apr 22 18:40:20 2003  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* stor-layout.c (compute_record_mode): Relax restriction
	on fields crossing word boundaries forcing BLKmode.

*** gcc/stor-layout.c	7 Aug 2002 23:16:43 -0000	1.118.2.3.4.2
--- gcc/stor-layout.c	22 Apr 2003 20:08:56 -0000
*************** compute_record_mode (type)
*** 1240,1245 ****
  	  != ((tree_low_cst (DECL_SIZE (field), 1) + bitpos - 1)
  	      / BITS_PER_WORD)
! 	  /* But there is no problem if the field is entire words.  */
! 	  && tree_low_cst (DECL_SIZE (field), 1) % BITS_PER_WORD != 0)
  	return;
  
--- 1237,1244 ----
  	  != ((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;


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