[m-dev.] Looks like a GCC problem

Ralph Becket rafe at cs.mu.OZ.AU
Mon Feb 17 16:54:58 AEDT 2003


Fergus Henderson, Monday, 17 February 2003:
> 
> I couldn't reproduce this one.
> 
> Which version of gcc are you using?
> Can you add "EXTRA_MGNUCFLAGS=--verbose" to Mmake.params,
> so that it prints out the exact gcc invocation?

How odd.  I've just scratched that workspace, checked out a brand new
one and retried with the same results.  The only thing I'm adding here
is an Mmake.params file with "LIBGRADES = asm_fast.gc.tr.debug" line.

The version of gcc I'm using on ceres is 2.95.4.

> In general, these result from the use of memcpy(), memcmp(), 
> bzero(), or structure assignment.  The work-around is to use
> MR_memcpy(), MR_assign_struct(), etc. -- see
> runtime/mercury_reg_workarounds.h.  Unfortunately GCC
> won't give you the exact line number, just the name of the
> function which is affected.  Look for recent changes to
> that function, or try splitting it up, commenting out
> parts, etc. until you figure out which part of the function
> is causing the problem.

Will do.  The only function in this family in the file is strcpy.
Adding MR_strcpy as

void
MR_strcpy(void *dest, const void *src)
{
        char            *d = (char *) dest;
        const char      *s = (const char *) src;

        while((*d++ = *s++) != '\0');
}

to mercury_reg_workarounds.[ch] doesn't fix the problem.  Nor does
commenting out the switch in mercury_ml_expand_body.h where GCC reports the
problem.

I'll keep looking.

Cheers,
	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