From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: inline trouble Date: 24 Jan 2000 17:42:35 GMT Organization: Aachen University of Technology (RWTH) Lines: 27 Message-ID: <86i2ub$jn8$1@nets3.rz.RWTH-Aachen.DE> References: <86i0tf$jnf$1 AT inf6serv DOT rug DOT ac DOT be> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 948735755 20200 137.226.32.75 (24 Jan 2000 17:42:35 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 24 Jan 2000 17:42:35 GMT User-Agent: tin/1.4-19991113 ("No Labels") (UNIX) (Linux/2.0.0 (i586)) Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hans Yperman wrote: > typedef unsigned char byte; > void repstosd(byte *to,int len,int val){ > asm("rep; stosl" > ::"a" (val),"D"(to),"c"(len) > :"%edi","%ecx"); > } > inlines.c:5: fixed or forbidden register 2 (cx) was spilled for class > CREG. > With Djgpp v2.01, this worked, but friday i downloaded the last > version (gcc --version = 2.952) from www.delorie.com, and this happened. It's not a question of DJGPP, but of gcc version. gcc-2.95.2 is considerably less forgiving regarding not quite correct extended inline assembly than old gcc-2.8.1 was. You're not allowed to mark the same register both as 'input' and 'dirty', IIRC. The GCC home page has more details on this. On a side issue: why not just use plain old 'memset'? At the heart of it, it already uses 'rep stosl', in DJGPP's libc, so there may no really be a need to roll your own... -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.