delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/01/06:34:05

Date: Mon, 1 Jul 1996 13:27:56 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Samuli Takala <tax AT cc DOT hut DOT fi>
Cc: djgpp AT delorie DOT com
Subject: Re: DJGPP inlining functions...
In-Reply-To: <Pine.OSF.3.93.960701032210.3478A-100000@alpha.hut.fi>
Message-Id: <Pine.SUN.3.91.960701131718.17336C-100000@is>
Mime-Version: 1.0

On Mon, 1 Jul 1996, Samuli Takala wrote:

> First I think I should mention that I use C, not C++.
> I wrote a function that has some assembly-code, including branches (and
> of course labels). It works fine when the code is compiled without
> optimations or with -O2. The problem is, when I'm compiling with -O3,
> DJGPP insists on inlining that function. This causes the labels to appear
> more than once in the code and the assembler chokes on it.
> My question:
> 
> How can I fix my problem? Here is a list of ways in order of preference:

None of the above.  Just use labels local to the function, like this:

	asm("
	0:      decl    %%ecx
	        jnz     0b");

Also note that when jumping to numbered labels the 'b' and 'f' tags are 
use for backward and forward jump respectively.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019