[m-dev.] diff: work around gcc global register problem

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 15 15:50:37 AEDT 2000


On 15-Nov-2000, David Glen JEFFERY <dgj at cs.mu.OZ.AU> wrote:
> On 15-Nov-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > Estimated hours taken: 1
> > 
> > library/string.m:
> > 	Work around a GNU C problem in grade asm_fast.gc.tr.debug,
> > 	where gcc failed to compile the recently-added `set_char' procedures,
> > 	aborting with the following message:
> > 
> > 		string.c: In function `string_module70':
> > 		string.c:46208: fixed or forbidden register 3 (bx) was
> > 			spilled for class GENERAL_REGS.
> > 		This may be due to a compiler bug or to impossible asm
> > 		statements or clauses.
> > 
> > 	The work-around was to move the code which actually sets the
> > 	character into a separate C function.
> 
> FYI, this bug also occurs in the random module in the library in one of
> the HAL grades (asm_fast.gc.tr.rt.se.init, IIRC).
> 
> For now, I have just disabled the random library on the installation I do
> at Monash. Do you want a bug report? It isn't affecting us at all, but maybe
> the fix is as simple as the one in string.m, so you may want to fix it.

The change to string.m is a work-around, not a fix.
If you already have a work-around that works for you, then be happy ;-)
I'd rather spend time working on a fix than on another work-around.

There's two possible fixes in this case: (1) fix gcc itself (the gcc
maintainers have shown no interest in this) or (2) avoid using gcc
global registers, e.g. by switching to the MLDS back-end.  Recently
I've been working on improving the MLDS back-end, to make (2) more feasible.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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