[m-rev.] for review: Fix boxing/unboxing of 64-bit integers in pregen grades.

Julien Fischer jfischer at opturion.com
Tue Mar 13 13:58:42 AEDT 2018


Hi Peter,

On Tue, 13 Mar 2018, Peter Wang wrote:

> 64-bit integers should be boxed in .pregen grades.
> We forgot to define MR_BOXED_INT64S in .pregen grades so the wrong

The "We" is very generous of you!

> definitions of the MR_(un)box_(u)int64 macros were being used
> when compiling pregenerated C source files on 64-bit machines.
> Fixes bug #454.
>
> runtime/mercury_conf_param.h:
>    Define MR_BOXED_INT64S in .pregen grades.
>
> runtime/mercury_conf.h.in:
> runtime/mercury_engine.h:
>    Update some comments.
> ---
> runtime/mercury_conf.h.in    | 17 +++++++----------
> runtime/mercury_conf_param.h |  3 +++
> runtime/mercury_engine.h     |  3 +--
> 3 files changed, 11 insertions(+), 12 deletions(-)
>

...

> diff --git a/runtime/mercury_conf_param.h b/runtime/mercury_conf_param.h
> index 2f6cc0b04..96106ed09 100644
> --- a/runtime/mercury_conf_param.h
> +++ b/runtime/mercury_conf_param.h
> @@ -1,6 +1,7 @@
> // vim: ts=4 sw=4 expandtab ft=c
> 
> // Copyright (C) 1997-2007, 2009-2011 The University of Melbourne.
> +// Copyright (C) 2013-2018 The Mercury team.
> // This file may only be copied under the terms of the GNU Library General
> // Public License - see the file COPYING.LIB in the Mercury distribution.
> 
> @@ -141,6 +142,7 @@
> // MR_NATIVE_GC
> // MR_NO_TYPE_LAYOUT
> // MR_BOXED_FLOAT
> +// MR_BOXED_INT64S
> // MR_USE_TRAIL
> // MR_USE_MINIMAL_MODEL_STACK_COPY
> // MR_USE_MINIMAL_MODEL_OWN_STACKS
> @@ -629,6 +631,7 @@
>   #undef  MR_LOW_TAG_BITS
>   #define MR_LOW_TAG_BITS  2
>   #define MR_BOXED_FLOAT   1
> +  #define MR_BOXED_INT64S  1
> #endif

I think there needs to be a comment in compiler/handle_options.m
pointing to this code (i.e. from the code that handles the implications
of the pregenerated_dist option) and the other way around.

The diff is fine otherwise.

Julien.


More information about the reviews mailing list