delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/05/05/19:51:46

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3
content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: Object alignment, was: cygwin failures - assertion "!(addr & FLAGS)" failed:
Date: Mon, 6 May 2002 09:49:31 +1000
Message-ID: <FAC87D7C874EAB46A847604DA4FD5A6403470E@crtsmail.corp.riotinto.org>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
From: "Billinghurst, David (CRTS)" <David DOT Billinghurst AT riotinto DOT com>
To: <java AT gcc DOT gnu DOT org>
Cc: <cygwin AT cygwin DOT com>
X-OriginalArrivalTime: 05 May 2002 23:50:33.0492 (UTC) FILETIME=[A55CFD40:01C1F48F]
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g45NpkA19853

cygwin readers:  This is about porting java to cygwin for gcc-3.2
(and perhaps gcc-3.1.1 if the changes are small).

So we need objects to be 8-byte aligned so that the low three bits
of the address are 0?  Are there any ways around this, as I don't 
think that this is the default on cygwin.  

I seem to recall that:
 - objects are only 4-byte aligned by default.  
 - it is necessary to rebuild ld to ensure 8-byte alignment
 - there are performance benefits for 8-byte (or even 16-byte)
   alignment, but arguements against.

There is much discussion over a long period in the cygwin archives,
which I will obviously have to re-read in the next little while.

-----Original Message-----
From: Tom Tromey [mailto:tromey AT redhat DOT com]
Sent: Saturday, 4 May 2002 6:31 
To: Billinghurst, David (CRTS)
Cc: java AT gcc DOT gnu DOT org
Subject: Re: cygwin failures - assertion "!(addr & FLAGS)" failed:


>>>>> "David" == Billinghurst, David (CRTS) <David DOT Billinghurst AT riotinto DOT com> writes:

David> At last a real bug in the cygwin libjava testsuite.  Most of the 
David> compilation tests pass, but all (that I could find) executable 
David> tests fail with 

David> assertion "!(addr & FLAGS)" failed: file "/usr/local/src/gcc3.1/libjava/java/lang/natObject.cc", line 772

My understanding is that we use the lowest 3 bits to keep some
information about the thin locks.  If this assertion fails, it means
that we've found an object which isn't suitably aligned.  I think this
can mean one of two things:

1. There is a bug in the allocator (unlikely), or
2. The compiler isn't properly aligning an object which it lays out
   statically.  For instance this could happen with some Class object

A bug along these lines was fixed pretty recently:

2002-04-18  Bryce McKinlay  <bryce AT waitaki DOT otago DOT ac DOT nz>

	* class.c (make_class_data): Set DECL_ALIGN on static class data,
	for hash synchronization.
	* expr.c (java_expand_expr): Set DECL_ALIGN on static array objects.
	* decl.c (java_init_decl_processing): Don't set TYPE_ALIGN for
	class_type_node.

If you already have this patch then I guess there's another such bug :-(

Tom

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019