From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA16662; Sat, 20 Dec 2003 15:59:02 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA16310 for ; Sat, 20 Dec 2003 15:59:01 +0100 (MET) Received: from mail1.tpgi.com.au (mail.tpgi.com.au [203.12.160.57]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hBKEwwH26063; Sat, 20 Dec 2003 15:58:58 +0100 (MET) Received: from syd-ts22-2600-034.tpgi.com.au (syd-ts22-2600-034.tpgi.com.au [203.26.30.34]) by mail1.tpgi.com.au (8.11.6/8.11.6) with ESMTP id hBKEwsY08633; Sun, 21 Dec 2003 01:58:54 +1100 Subject: Re: [Caml-list] Re: Marshalling tests fail on AMD x86_64 (Opteron). (PR#1979) From: skaller Reply-To: skaller@ozemail.com.au To: Xavier Leroy Cc: nogin@cs.caltech.edu, caml-list In-Reply-To: <20031220123004.A9913@pauillac.inria.fr> References: <200312160316.EAA00843@pauillac.inria.fr> <20031220123004.A9913@pauillac.inria.fr> Content-Type: text/plain Message-Id: <1071932331.12625.28.camel@pelican> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 21 Dec 2003 01:58:52 +1100 Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 marshalling:01 1979:99 ozemail:01 segfault:01 bug:01 gcc:01 unspecified:01 int':01 int':01 gcc:01 unix's:01 operands:01 operand:01 rank:99 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sat, 2003-12-20 at 22:30, Xavier Leroy wrote: > > I am having problems with the marshaller (I am getting a segfault in the > The first test failure is either a bug in gcc or an unspecified > behavior of C that I wasn't aware of. Basically, some stuff is > computed with type 'unsigned int', stored in an 'unsigned long' > variable, and compared against an 'unsigned int' constant. The > gcc-generated code performs a sign extension 32 -> 64 bits on the > unsigned int, causing the test to fail. This behavior also occurs > with older versions of gcc on the Alpha. Digital Unix's Alpha cc > compiler (the only other 64-bit C compiler I have at hand) doesn't do > sign extension. A small example that reproduces the behavior is > attached. I'll let the C language lawyers argue what the correct > behavior is. Here is the rule for promotion of two values prior to a binary operation, from ISO 'C99' Standard: 6.3.1.8 Usual arithmetic conversions ... Otherwise, if both operands have signed integer types or both have unsigned integer types, the operand with the type of lesser integer conversion rank is converted to the type of the operand with greater rank. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners