On Mon, 2005-08-15 at 15:17 +0300, Denis Vlasenko wrote:
> > Seems like that optimization is not helping.
> > Do you have better example?
On Mon, 15 Aug 2005, Arjan van de Ven wrote:
> you need gcc 4.1 (eg CVS) for the value range propagation stuff.
For Denis' example, it does not seem to help. I must admit I did not know
GCC 3.x does not have this optimization. I am also bit confused as Adrian
and I saw small reduction in kernel text with kcalloc() inlined. If GCC
is, in fact, spreading the extra operations everywhere, shouldn't kernel
text be bigger?
Pekka
penberg@haji ~/tmp $ ~/bin/gcc-4.1-cvs/bin/gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/penberg/bin/gcc-4.1-cvs
--enable-languages=c
Thread model: posix
gcc version 4.1.0 20050815 (experimental)
penberg@haji ~/tmp $ ~/bin/gcc-4.1-cvs/bin/gcc -O -S -mcpu=i386 t.c
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
penberg@haji ~/tmp $ cat t.s
.file "t.c"
.text
.globl f
.type f, @function
f:
pushl %ebp
movl %esp, %ebp
pushl %ebx
subl $4, %esp
movl 12(%ebp), %eax
cmpl $999, %eax
jg .L2
movl %eax, %ebx
movl 8(%ebp), %ecx
testl %ecx, %ecx
je .L4
movl $2147483647, %eax
movl $0, %edx
divl %ecx
cmpl %eax, %ebx
ja .L2
.L4:
subl $8, %esp
pushl $1
movl %ebx, %eax
imull %ecx, %eax
pushl %eax
call kzalloc
addl $16, %esp
jmp .L6
.L2:
movl $0, %eax
.L6:
movl -4(%ebp), %ebx
leave
ret
.size f, .-f
.ident "GCC: (GNU) 4.1.0 20050815 (experimental)"
.section .note.GNU-stack,"",@progbits
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|