www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/17/22:16:55

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How prevent GCC from inlining a function?
Date: Fri, 17 Apr 1998 21:47:24 -0400
Organization: Two pounds of chaos and a pinch of salt.
Lines: 40
Message-ID: <3538062C.273@cs.com>
References: <3537E4CB DOT 5B59 AT icrdl DOT net>
NNTP-Posting-Host: ppp211.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Michel Huot wrote:
> 
> void foo(. . .)
> {
>   asm volatile (" ...
>         Loop1:    ...
>                   loop Loop1
>                   ... ");
> }
> 
> GCC compiles and say me that Loop1 is already defined. I found that
> everywhere I call foo, the compiler inline it and put the label "Loop1".
> 
> Im wondering how can I prevet GCC from inlining this function? Is there
> a pragma or something like that?

You can use local labels to avoid that problem.  Instead of "Loop1" and
"Loop2", use "0" and "1" instead.  You refer to them by using the
number, plus the letter 'b' to specify a previous label, or 'f' to
specify a succeeding label.  Using your example:

void foo( ... )
{
    asm volatile (" ...
          0:        ...
                    loop 0b
                    ... ");
}

For more information, type ``info as symbol "symbol names"''.

hth!

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |     mailto:fighteer AT cs DOT com     |
|      ICQ UIN#:  7406319          |   http://www.cs.com/fighteer/  |
|    ObJoke:  If Bill Gates were a robber, not only would he        |
|     shoot you, but he'd send you a bill for the bullets.          |
---------------------------------------------------------------------

- Raw text -


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