[m-dev.] Looks like a GCC problem

Ralph Becket rafe at cs.mu.OZ.AU
Tue Feb 18 14:55:16 AEDT 2003


Hi Fergus,

can you give me any stronger hints about tackling this one?  I'm not
making much headway.

By commenting out the entire body of the template starting at line 249
in mercury_ml_expand_body.h I made some slight progress: gcc now aborts
on mercury_deconstruct.c in MR_expand_type_name - a much smaller
function.

Binary search with comments reveals the culprit there to be the macro
instance

    MR_allocate_aligned_string_msg(str, len, "MR_expand_type_name");

which expands (mercury_string.h) as

#define MR_allocate_aligned_string_msg(ptr, len, proclabel)             \
        do {                                                            \
                MR_Word make_aligned_string_tmp;                        \
                char * make_aligned_string_ptr;                         \
                                                                        \
                MR_incr_hp_atomic_msg(make_aligned_string_tmp,          \
                    ((len) + sizeof(MR_Word)) / sizeof(MR_Word),        \
                    proclabel, "string:string/0");                      \
                make_aligned_string_ptr =                               \
                    (char *) make_aligned_string_tmp;                   \
                (ptr) = (MR_String) make_aligned_string_ptr;            \
        } while(0)

Further investigation narrows the problem to the MR_incr_hp_atomic_msg
statement, thence to MR_tag_incr_hp_atomic_msg, and none of the
definitions of that that I can see do any kind of structure assignment
or make calls to memcmp, memcpy or bzero.

I'm finding it rather difficult to make progress on my to-do list given
that I can't compile the compiler!  Any help would be very gratefully
received.

	Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list