From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 878157ED5C for ; Mon, 6 Aug 2012 12:20:14 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dmitry.bely@gmail.com) identity=pra; client-ip=209.85.220.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dmitry.bely@gmail.com"; x-sender="dmitry.bely@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of dmitry.bely@gmail.com designates 209.85.220.182 as permitted sender) identity=mailfrom; client-ip=209.85.220.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dmitry.bely@gmail.com"; x-sender="dmitry.bely@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vc0-f182.google.com) identity=helo; client-ip=209.85.220.182; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="dmitry.bely@gmail.com"; x-sender="postmaster@mail-vc0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCALWPH1DRVdy2m2dsb2JhbABFuTYIIgEBAQEBCAkLCRQngiABAQEEEgIsARseAwwGBQsNLiIBEQEFARwZCBqHWwEDDJ0CCQOMI4JxhF4KGScNV4hxAQUMiz6DaIMcA4hHjQKOLz6EAw X-IronPort-AV: E=Sophos;i="4.77,718,1336341600"; d="scan'208";a="152518980" Received: from mail-vc0-f182.google.com ([209.85.220.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 06 Aug 2012 12:20:13 +0200 Received: by mail-vc0-f182.google.com with SMTP id gb22so4217337vcb.27 for ; Mon, 06 Aug 2012 03:20:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=XPzY5s8hc6FdRUgkdoj1ZEXLZckBNQl4qSg3bEiijIM=; b=EVUBoDwXGnttOfyyutxSVYQhikAX3ePm5IdBpvNKyvUfE3qI6D1fPUsJXGLA0Npzam Xl0wlPvUcesrK0zuvNm8436gwfpakB45D7aJ5liEU1H9u/5cu305St2jv3zWrI+fJpA9 ubj9hivjPYR5nLfc7EnLpKJp0tG4SoYY8EeDctBAE1gN4qwVUp1UWRT0bswd3wcrmTTr sJy7EOcb5poVN0IujzvwMGZmy8J52wmybFHa3DgWd82wSlUrgi87PBTq0jqpvD9pxthM Zc3QdO/XBuaBW5wo3ZkvkDguFpl8BbOEtkPW7SY+cBejtRI5U21S8EeAvM6wkC6OFsG1 TDxw== MIME-Version: 1.0 Received: by 10.220.215.66 with SMTP id hd2mr7590987vcb.55.1344248413490; Mon, 06 Aug 2012 03:20:13 -0700 (PDT) Received: by 10.220.117.66 with HTTP; Mon, 6 Aug 2012 03:20:13 -0700 (PDT) In-Reply-To: <501F9855.6080709@frisch.fr> References: <501F9855.6080709@frisch.fr> Date: Mon, 6 Aug 2012 14:20:13 +0400 Message-ID: From: Dmitry Bely To: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Compiler bug? On Mon, Aug 6, 2012 at 2:11 PM, Alain Frisch wrote: > On 08/06/2012 12:04 PM, Dmitry Bely wrote: >> >> X parameter is passed as a pointer to float value ([eax] which is >> immediately saved to [ebx]). But If GC happens (L102), float value can >> be moved around the OCaml heap and [ebx] become invalid, right? So the >> generated code is just wrong. Am I missing something? > > > The GC knows about the location of OCaml values, including those stored in > registers when it is called (the compiler generate tables to retrieve this > information from the GC call site). These values are used as roots for the > GC, and they are updated when the value is moved. I always thought that local roots are memory-based. How GC knows that in this case [ebx] should be updated? (remember, the parameter was passed in [eax]) Could you point me to the relevant part of Ocaml compiler sources? - Dmitry Bely