[m-dev.] Mercury's non-local gotos and gcc 4

Peter Hawkins peter at hawkins.emu.id.au
Fri Jul 8 15:56:27 AEST 2005


Hi...
Peter Hawkins wrote:

>
> Any suggestions as to how to convince gcc not to do this?

I've attached 2 patches that seem to convince gcc to do the right thing. 
With these I'm able to build and run a few example programs with mercury 
and gcc 4. They add the line:
__asm__ __volatile__(""::: "memory");
after each non-local entry point, which stops gcc from assuming things 
about the contents of memory.

I can't build the compiler itself with gcc 4. It dies with this error:
../scripts/mgnuc --grade asm_fast.gc      --no-mercury-stdlib-dir 
--c-debug --no-ansi   --       -c mercury_deep_copy.c -o mercury_deep_copy.o
mercury_deep_copy_body.h: In function 'MR_deep_copy_typeclass_info':
mercury_deep_copy_body.h:1000: error: unable to find a register to spill 
in class 'GENERAL_REGS'
mercury_deep_copy_body.h:1000: error: this is the insn:
(insn:HI 93 92 94 8 mercury_deep_copy_body.h:979 (set (reg:SI 0 ax)
        (mem:SI (reg:SI 64 [ ivtmp.113 ]) [0 S4 A32])) 41 {*movsi_1} (nil)
    (nil))
mercury_deep_copy_body.h:1000: confused by earlier errors, bailing out

I'll take a look at this next.

=)
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.patch
Type: text/x-patch
Size: 780 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/developers/attachments/20050708/ccfc4bc0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc4-fix.patch
Type: text/x-patch
Size: 614 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/developers/attachments/20050708/ccfc4bc0/attachment-0001.bin>


More information about the developers mailing list