This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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]

Re: pr23467 fallout status?


Richard Henderson wrote:


What's the status of fixing the libgcj failures caused by this patch?


The problem was reported to you yesterday; I was hoping to see something
from you today fixing the problem -- or at least discussing it. I'll
revert the patch tomorrow if I don't hear anything.


I've applied the attached patch under the obvioud rule - it reverts the change
for non-aggregate types, i.e. you get the same behaviour as before for
!STRICT_ALIGNMENT targets like i686-pc-linux-gnu.
I've verified that bool is back to 8 bit alignment, and that stage2/stor-layout.o is
built without warnings.


We should probably still do something about char_type_node, though.  Im java
it can't be both the character type and the type of an addressable unit
(unless we are talking specifically about a word-addressing target ;-).
2005-08-26  J"orn Rennecke <joern.rennecke@st.com>

	* stor-layout.c (finalize_type_size): Restore behaviour for
	non-aggregate types to the status quo ante of the patch for
	pr 23467.  Document why it matters.

Index: stor-layout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stor-layout.c,v
retrieving revision 1.239
diff -p -r1.239 stor-layout.c
*** stor-layout.c	23 Aug 2005 12:27:53 -0000	1.239
--- stor-layout.c	26 Aug 2005 16:47:30 -0000
*************** finalize_type_size (tree type)
*** 1399,1421 ****
    /* Normally, use the alignment corresponding to the mode chosen.
       However, where strict alignment is not required, avoid
       over-aligning structures, since most compilers do not do this
!      alignment.  */
  
    if (TYPE_MODE (type) != BLKmode && TYPE_MODE (type) != VOIDmode
!       && (STRICT_ALIGNMENT
  	  || (TREE_CODE (type) != RECORD_TYPE && TREE_CODE (type) != UNION_TYPE
  	      && TREE_CODE (type) != QUAL_UNION_TYPE
  	      && TREE_CODE (type) != ARRAY_TYPE)))
      {
!       unsigned mode_align = GET_MODE_ALIGNMENT (TYPE_MODE (type));
! 
!       /* Don't override a larger alignment requirement coming from a user
! 	 alignment of one of the fields.  */
!       if (mode_align >= TYPE_ALIGN (type))
! 	{
! 	  TYPE_ALIGN (type) = mode_align;
! 	  TYPE_USER_ALIGN (type) = 0;
! 	}
      }
  
    /* Do machine-dependent extra alignment.  */
--- 1399,1421 ----
    /* Normally, use the alignment corresponding to the mode chosen.
       However, where strict alignment is not required, avoid
       over-aligning structures, since most compilers do not do this
!      alignment.  Also, we must avoid overriding a larger alignment
!      requirement coming from a user alignment of one of the fields.  */
!   /* ??? The non-aggregate code is also needed to reduce the alignment
!      of java types with alignment less than 16 bits.  The problem stems
!      from java/decl.c using char_type_node for the 16 bit character type,
!      while tree.c:make_node uses it as the type of the smallest addressable
!      unit to initialize the alignment of all types.  */
!   unsigned mode_align = GET_MODE_ALIGNMENT (TYPE_MODE (type));
  
    if (TYPE_MODE (type) != BLKmode && TYPE_MODE (type) != VOIDmode
!       && ((STRICT_ALIGNMENT && mode_align >= TYPE_ALIGN (type))
  	  || (TREE_CODE (type) != RECORD_TYPE && TREE_CODE (type) != UNION_TYPE
  	      && TREE_CODE (type) != QUAL_UNION_TYPE
  	      && TREE_CODE (type) != ARRAY_TYPE)))
      {
!       TYPE_ALIGN (type) = mode_align;
!       TYPE_USER_ALIGN (type) = 0;
      }
  
    /* Do machine-dependent extra alignment.  */

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