[m-rev.] for review: align functions in trailing grades

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Jan 22 22:20:39 AEDT 2008


On Tue, 22 Jan 2008, Mark Brown wrote:

> On 22-Jan-2008, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
>> In trailing grades, pass flags to the C compiler that force it to align
>> functions on word boundaries.  For some architectures, and for some C
>> compiler
>> optimisation settings, function addresses are not aligned and this breaks
>> function trailing when using tagged trail entries.
>
> ...
>
>> compiler/compile_target_code.m:
>> scripts/mgnuc.in:
>> 	When in a trailing grade and using gcc as a C compiler align
>> 	functions on word boundaries in order to avoid problems
>> 	with function trailing.
>
> This only needs to be done for tagged trails.  Did you mean to pass the
> option always, even if the `--disable-tagged-trail' configuration option
> is given?

Yes, it won't do any harm in that case.  I can't really see the untagged
trail being used that often since most of the common architectures on
which Mercury is used support tagged trail entries, the G12 FD benchmarks
are between 1-2% faster with a tagged trail and a tagged trail uses less
memory.

> It doesn't matter that much, since I can't see how passing the option will
> cause any significant harm, and it could be a fair bit of hassle to also
> check if the trail is tagged.
> So I'm happy for you to commit this as is,
> although a comment in mgnuc.in saying that the option needs to be passed
> because the trail *might* be tagged would be good.

There is already such a comment in compile_target_code.m - I'll add
a pointer to that from mgnuc.in and also mention that it affects
the untagged trail.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list