Date: Mon, 29 Dec 1997 10:52:05 -0800 (PST) Message-Id: <199712291852.KAA11528@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Thomas Demmer , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: error optimisation with label Precedence: bulk At 08:56 12/28/1997 +0100, Thomas Demmer wrote: >leger_v AT bluewin DOT ch wrote: >> >> Could someone tell me why when I put any labels (ex : loop3 : ...) >> in my inline assembly, I obtain when I compile my program, only with >> optimisation -O3 : >> "fatal error : loop3 already defined" > >Because -O3 enables loop unrolling, so the name loop3 gets reused. >I think you have to use something like unnamed labels or relative >jumps, but better wait for the answer of an assembler guru ;-) Right. In general, you shouldn't use named labels in inline assembly, since you don't know what other ones the compiler might have defined. The correct solution is to use local labels, which have meaning only to the code close to them. For information, see this Info node: info "as" "symbols" "symbol names" and scroll down about 20 lines. Incidentally, I think the reason for the conflict is not that `-O3' does loop unrolling (because it doesn't), but that it enables function inlining. The compiler inlines the function containing your asm code, which means it shows up in multiple places. Nate Eldredge eldredge AT ap DOT net