Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: skaller <skaller@ozemail.com.au>
To: Xavier Leroy <xavier.leroy@inria.fr>
Cc: nogin@cs.caltech.edu, caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: Marshalling tests fail on AMD x86_64 (Opteron). (PR#1979)
Date: 21 Dec 2003 01:58:52 +1100	[thread overview]
Message-ID: <1071932331.12625.28.camel@pelican> (raw)
In-Reply-To: <20031220123004.A9913@pauillac.inria.fr>

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


  reply	other threads:[~2003-12-20 14:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200312160316.EAA00843@pauillac.inria.fr>
2003-12-20 11:30 ` Xavier Leroy
2003-12-20 14:58   ` skaller [this message]
2003-12-20 16:45   ` John Carr
2003-12-22  6:44   ` Aleksey Nogin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1071932331.12625.28.camel@pelican \
    --to=skaller@ozemail.com.au \
    --cc=caml-list@inria.fr \
    --cc=nogin@cs.caltech.edu \
    --cc=xavier.leroy@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox