[m-dev.] gcc abort on runtime/mercury_atomic_ops.c

Peter Wang novalazy at gmail.com
Mon Oct 22 19:25:19 AEST 2007


On 2007-10-22, Zoltan Somogyi <zs at csse.unimelb.edu.au> wrote:
> On my laptop (alys, a Dell Inspiron 9400 with an Intel T2500 CPU), I get
> the following error from gcc:
> 
> ../scripts/mgnuc --grade asm_fast.gc      --c-debug --no-ansi   --   -O0 -g    -c mercury_atomic_ops.c -o mercury_atomic_ops.o
> mercury_atomic_ops.c: In function `MR_compare_and_swap_word':
> mercury_atomic_ops.c:22: error: can't find a register in class `GENERAL_REGS' while reloading `asm'

I get the same problem with gcc 4.1.2.  However, the problem goes away
if I use the definition of cas that calls __sync_bool_compare_and_swap.
That'd be a reason to prefer the gcc extension when it is available.

I have no objection to Julien's proposal.

Peter

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



More information about the developers mailing list