[PATCH][2.6.7-rc2] gcc-3.4.0 warning in i386 __down_read_trylock()

From: Mikael Pettersson (mikpe_at_csd.uu.se)
Date: 05/30/04

  • Next message: Christian Kujau: "unable to compile 2.4 with gcc-3.4.0"
    Date:	Sun, 30 May 2004 12:47:05 +0200 (MEST)
    To: torvalds@osdl.org
    
    

    The i386 __down_read_trylock() code contains a "+m" asm
    constraint, which triggers warnings from gcc-3.4.0:

      gcc -Wp,-MD,fs/xfs/.xfs_iget.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -msoft-float -mpreferred-stack-boundary=2 -fno-unit-at-a-time -march=k8 -Iinclude/asm-i386/mach-default -O2 -fomit-frame-pointer -Wdeclaration-after-statement -Ifs/xfs -Ifs/xfs/linux-2.6 -funsigned-char -DKBUILD_BASENAME=xfs_iget -DKBUILD_MODNAME=xfs -c -o fs/xfs/xfs_iget.o fs/xfs/xfs_iget.c
    include/asm/rwsem.h: In function `xfs_ilock_nowait':
    include/asm/rwsem.h:126: warning: read-write constraint does not allow a register
    include/asm/rwsem.h:126: warning: read-write constraint does not allow a register
    include/asm/rwsem.h:126: warning: read-write constraint does not allow a register
    include/asm/rwsem.h:126: warning: read-write constraint does not allow a register

    Fixed by the patch below.

    /Mikael

    diff -ruN linux-2.6.7-rc2/include/asm-i386/rwsem.h linux-2.6.7-rc2.gcc340-fixes/include/asm-i386/rwsem.h
    --- linux-2.6.7-rc2/include/asm-i386/rwsem.h 2003-03-08 17:22:32.000000000 +0100
    +++ linux-2.6.7-rc2.gcc340-fixes/include/asm-i386/rwsem.h 2004-05-30 11:39:07.000000000 +0200
    @@ -134,8 +134,8 @@
                     " jnz 1b\n\t"
                     "2:\n\t"
                     "# ending __down_read_trylock\n\t"
    - : "+m"(sem->count), "=&a"(result), "=&r"(tmp)
    - : "i"(RWSEM_ACTIVE_READ_BIAS)
    + : "=m"(sem->count), "=&a"(result), "=&r"(tmp)
    + : "i"(RWSEM_ACTIVE_READ_BIAS), "m"(sem->count)
                     : "memory", "cc");
             return result>=0 ? 1 : 0;
     }
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Christian Kujau: "unable to compile 2.4 with gcc-3.4.0"

    Relevant Pages

    • Re: [parisc-linux] Re: [PATCH 3/9] mm: parisc pte atomicity
      ... using your own tmpalias area sounds much better than getting ... I've simply not wrapped my head around the races, ... it looks like we agree that my patch is necessary and valid as is; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: keyboard - was: Re: Linux 2.6.0-test4
      ... >> I was able to get the key unstuck by switching back and forth between ... I rebuild my kernel including your patch; ... I'll get back to you once I verify that the problem doesn't occur ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.0-test8/test9 io scheduler needs tuning?
      ... interactivity with regard to desktop use. ... Going to improve the time info output of the ddd loops to get better data and ... with the patch the hang reported earlier was not encountered again so ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [CFT][PATCH] 2.6.4-rc1 remove x86 boot page tables
      ... > For VISWS I think you actually need to turn paging off explicitly. ... The patch will need a few tweaks but it should be fairly straight forward. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] clarify message and give support contact for non-GPL modules
      ... The author of the second module ... So here is another attempt at the patch. ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)