xfs
[Top] [All Lists]

Re: linux/fs/xfs/xfs_log.h:_lsn_cmp not declared __inline__ with gcc 2.9

To: Chris Wedgwood <cw@xxxxxxxx>
Subject: Re: linux/fs/xfs/xfs_log.h:_lsn_cmp not declared __inline__ with gcc 2.95
From: Steve Lord <lord@xxxxxxx>
Date: 14 Feb 2003 14:18:12 -0600
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20030214201059.GA25006@f00f.org>
Organization:
References: <20030214201059.GA25006@f00f.org>
Sender: linux-xfs-bounce@xxxxxxxxxxx
On Fri, 2003-02-14 at 14:10, Chris Wedgwood wrote:
> linux/fs/xfs/xfs_log.h seems to want to declare _lsn_cmp() only for
> GCC versions != 2.95.
> 
> Why is this?

The way I remember it - 2.95 generated bad code here.

We made a number of changes:

date: 2001/02/13 00:33:03;  author: cattelan;  state: Exp;  lines: +7 -1
modid: 2.4.x-xfs:slinx:87361a
This removes the "inline" from the lsn_cmp function. This function
appears to be incorrectly compiled by the gcc 2.95.x compiler.
This does produce a warning messages when compiling with the 2.95
compiler
fixing this would require code restructuring which would be incompatible
with the irix source.

Hopefully the compiler will be fixed in the future and the inline can
be restored.
date: 2001/04/18 16:19:03;  author: lord;  state: Exp;  lines: +1 -1
modid: 2.4.x-xfs:slinx:92837a
This particular compiler workaround appears to only be needed on 
one rev of gcc, make it go away for the others.

date: 2002/05/24 14:37:11;  author: lord;  state: Exp;  lines: +7 -7
modid: 2.4.x-xfs:slinx:120154a
Fix lsn_cmp warnings with gcc 2.95 compiler




Steve

> 
> It means with gcc-2.95 we get lots of copies of this function declared
> and never used.
> 
> The following patch prevents this and seems to work perfect with
> 2.95...
> 
> 
> ===== fs/xfs/xfs_log.h 1.2 vs edited =====
> --- 1.2/fs/xfs/xfs_log.h      Mon Feb  3 10:19:33 2003
> +++ edited/fs/xfs/xfs_log.h   Fri Feb 14 00:18:21 2003
> @@ -52,12 +52,7 @@
>   * By comparing each compnent, we don't have to worry about extra
>   * endian issues in treating two 32 bit numbers as one 64 bit number
>   */
> -static
> -#ifdef __GNUC__
> -# if !((__GNUC__ == 2) && (__GNUC_MINOR__ == 95))
> -__inline__
> -#endif
> -#endif
> +static __inline__
>  xfs_lsn_t    _lsn_cmp(xfs_lsn_t lsn1, xfs_lsn_t lsn2, xfs_arch_t arch)
>  {
>       if (CYCLE_LSN(lsn1, arch) != CYCLE_LSN(lsn2, arch))
> 
> 
> 
>   --cw
-- 

Steve Lord                                      voice: +1-651-683-3511
Principal Engineer, Filesystem Software         email: lord@xxxxxxx


<Prev in Thread] Current Thread [Next in Thread>