gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] attribute noreturn for abortgo()


From: Dave Denholm
Subject: Re: [gnugo-devel] attribute noreturn for abortgo()
Date: Mon, 19 Apr 2004 14:18:54 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (usg-unix-v)

Arend Bayer <address@hidden> writes:

> This patch gives about 1% speedup. If GCC knows that abortgo() will never
> return it can avoid to save registers before calling it (making code size
> smaller), and reduce number of branch mispredictions by marking the assertions
> (which trigger the call to abortgo() ) as unlikely.
>
> If someone has suggestions how to make this more portable (Does this exist
> in other compilers at all?), they are welcome. The #ifdef is a little ugly
> but I think it is worth the speedup.
>

The MS VC stdlib.h has

/* function prototypes */

#if     _MSC_VER >= 1200
_CRTIMP __declspec(noreturn) void   __cdecl abort(void);
_CRTIMP __declspec(noreturn) void   __cdecl exit(int);
#else
_CRTIMP void   __cdecl abort(void);
_CRTIMP void   __cdecl exit(int);
#endif


if you are interested


dd
-- 
Dave Denholm              <address@hidden>       http://www.esmertec.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]