From: Theodore Ts'o Date: Wed, 29 Mar 2006 19:23:00 +0000 (-0500) Subject: Fix the x86 asm constraints for ext2fs_set/clear_bit. X-Git-Tag: E2FSPROGS-1.39-WIP-0330~5 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=8ad26b08fac068f0c50d44a5072fb49ab7bedc78;p=tools%2Fe2fsprogs.git Fix the x86 asm constraints for ext2fs_set/clear_bit. The assembly function reads/writes the data files, so make sure we tell gcc that. Signed-off-by: "Theodore Ts'o" --- diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index ac3cd69..4a12f78 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,9 @@ +2006-03-29 Theodore Ts'o + + * bitops.h (ext2fs_set_bit, ext2fs_clear_bit): Fix the constraints + so that GCC knows that the ext2fs_set/clear_bit reads and + writes the data. + 2006-03-25 Theodore Ts'o * Makefile.in: Check the bitfield operations much more carefully, diff --git a/lib/ext2fs/bitops.h b/lib/ext2fs/bitops.h index caaec5f..5d01838 100644 --- a/lib/ext2fs/bitops.h +++ b/lib/ext2fs/bitops.h @@ -181,7 +181,7 @@ _INLINE_ int ext2fs_set_bit(unsigned int nr, void * addr) addr = (void *) (((unsigned char *) addr) + (nr >> 3)); __asm__ __volatile__("btsl %2,%1\n\tsbbl %0,%0" - :"=r" (oldbit),"=m" (EXT2FS_ADDR) + :"=r" (oldbit),"+m" (EXT2FS_ADDR) :"r" (nr & 7)); return oldbit; } @@ -192,7 +192,7 @@ _INLINE_ int ext2fs_clear_bit(unsigned int nr, void * addr) addr = (void *) (((unsigned char *) addr) + (nr >> 3)); __asm__ __volatile__("btrl %2,%1\n\tsbbl %0,%0" - :"=r" (oldbit),"=m" (EXT2FS_ADDR) + :"=r" (oldbit),"+m" (EXT2FS_ADDR) :"r" (nr & 7)); return oldbit; }