Re: [PATCH] Always inline system calls

2008-01-10 Thread Mike Frysinger
On Tuesday 04 December 2007, Carmelo AMOROSO wrote:
 Paul Mundt wrote:
  On Mon, Dec 03, 2007 at 10:33:39PM +0100, Carmelo Amoroso wrote:
  Carmelo Amoroso wrote:
  while doing some test for SH4 to measure size increase for 'always
  inline' changes, doscovered suddenly that gcc-4.1.1 (cross sh4) fails
  with the following error:
 
  ../ldso/ldso/dl-elf.c: In function '_dl_dprintf':
  ../ldso/ldso/dl-elf.c:858: error: unable to find a register to spill in
  class 'R0_REGS' ../ldso/ldso/dl-elf.c:858: error: this is the insn:
  (insn 916 917 24 1 (set (reg/f:SI 1 r1 [219])
   (mem/u/c:SI (plus:SI (reg:SI 12 r12)
   (reg/f:SI 1 r1 [220])) [0 S4 A32])) 172 {movsi_ie}
  (nil) (expr_list:REG_DEAD (reg/f:SI 1 r1 [220])
   (expr_list:REG_EQUIV (symbol_ref:SI (_dl_pagesize) var_decl
  0x313a720 _dl_pagesize) (nil
 
  either running with -Os or -O0.
  I'll test tomorrow with gcc-4.2.1 to see if it makes difference,
  otherwise I suspect we should go back on my proposal in using always
  inline only for arch strictly requiring it.
 
  We've noticed this with some versions in buildroot also, so it seems to
  be a more common issue:

 Indeed at home I have gcc from buildroot. Tested just now at office
 using gcc-4.2.1 from STMicro toolchain
 and it works fine, either using -O0 or -Os.
 I'll try to update buildroot at home with gcc 4.2.1 as well and see if
 it solves.
 I'll keep you informed.

so what's up ?  bug in gcc ?  PR opened up stream ?  reduced test case made ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Re: [PATCH] Always inline system calls

2008-01-10 Thread Mike Frysinger
On Thursday 10 January 2008, Carmelo AMOROSO wrote:
 Mike Frysinger wrote:
  On Tuesday 04 December 2007, Carmelo AMOROSO wrote:
  Paul Mundt wrote:
  On Mon, Dec 03, 2007 at 10:33:39PM +0100, Carmelo Amoroso wrote:
  Carmelo Amoroso wrote:
  while doing some test for SH4 to measure size increase for 'always
  inline' changes, doscovered suddenly that gcc-4.1.1 (cross sh4) fails
  with the following error:
 
  ../ldso/ldso/dl-elf.c: In function '_dl_dprintf':
  ../ldso/ldso/dl-elf.c:858: error: unable to find a register to spill
  in class 'R0_REGS' ../ldso/ldso/dl-elf.c:858: error: this is the insn:
  (insn 916 917 24 1 (set (reg/f:SI 1 r1 [219])
   (mem/u/c:SI (plus:SI (reg:SI 12 r12)
   (reg/f:SI 1 r1 [220])) [0 S4 A32])) 172 {movsi_ie}
  (nil) (expr_list:REG_DEAD (reg/f:SI 1 r1 [220])
   (expr_list:REG_EQUIV (symbol_ref:SI (_dl_pagesize)
  var_decl 0x313a720 _dl_pagesize) (nil
 
  either running with -Os or -O0.
  I'll test tomorrow with gcc-4.2.1 to see if it makes difference,
  otherwise I suspect we should go back on my proposal in using always
  inline only for arch strictly requiring it.
 
  We've noticed this with some versions in buildroot also, so it seems to
  be a more common issue:
 
  Indeed at home I have gcc from buildroot. Tested just now at office
  using gcc-4.2.1 from STMicro toolchain
  and it works fine, either using -O0 or -Os.
  I'll try to update buildroot at home with gcc 4.2.1 as well and see if
  it solves.
  I'll keep you informed.
 
  so what's up ?  bug in gcc ?  PR opened up stream ?  reduced test case
  made ?

 yes is a bug in gcc. It seems that there is already a bug filed
 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28618#c13)
 but I'm not sure. gcc-4.2.1 from ST toolchain works fine. I've asked to
 our compiler team if it's possible to identify
 the single required to solve this.
 Also I have filed a bug to track this. See
 https://bugzilla.stlinux.com/show_bug.cgi?id=3093

thanks ... didnt want it to get lost in the shuffle :)
-mike


signature.asc
Description: This is a digitally signed message part.
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Re: [PATCH] Always inline system calls

2007-12-04 Thread Bernhard Fischer
On Tue, Dec 04, 2007 at 08:36:31AM +0100, Carmelo AMOROSO wrote:
Paul Mundt wrote:
 On Mon, Dec 03, 2007 at 10:33:39PM +0100, Carmelo Amoroso wrote:
   
 Carmelo Amoroso wrote:
 while doing some test for SH4 to measure size increase for 'always inline' 
 changes,
 doscovered suddenly that gcc-4.1.1 (cross sh4) fails with the following 
 error:

 ../ldso/ldso/dl-elf.c: In function '_dl_dprintf':
 ../ldso/ldso/dl-elf.c:858: error: unable to find a register to spill in 
 class 'R0_REGS'
 ../ldso/ldso/dl-elf.c:858: error: this is the insn:
 (insn 916 917 24 1 (set (reg/f:SI 1 r1 [219])
  (mem/u/c:SI (plus:SI (reg:SI 12 r12)
  (reg/f:SI 1 r1 [220])) [0 S4 A32])) 172 {movsi_ie} (nil)
  (expr_list:REG_DEAD (reg/f:SI 1 r1 [220])
  (expr_list:REG_EQUIV (symbol_ref:SI (_dl_pagesize) var_decl 
 0x313a720 _dl_pagesize)
  (nil

 either running with -Os or -O0.
 I'll test tomorrow with gcc-4.2.1 to see if it makes difference,
 otherwise I suspect we should go back on my proposal in using always inline
 only for arch strictly requiring it.

 
 We've noticed this with some versions in buildroot also, so it seems to
 be a more common issue:

   
Indeed at home I have gcc from buildroot. Tested just now at office 
using gcc-4.2.1 from STMicro toolchain
and it works fine, either using -O0 or -Os.
I'll try to update buildroot at home with gcc 4.2.1 as well and see if 
it solves.
I'll keep you informed.

Cheers,
Carmelo
   CC ldso/ldso/ldso.oS
In file included from 
 ./libpthread/linuxthreads.old/sysdeps/sh/tls.h:23,
  from ./include/bits/uClibc_errno.h:35,
  from ./include/errno.h:62,
  from ./include/bits/syscalls.h:16,
  from ./include/sys/syscall.h:34,
  from ./ldso/ldso/sh/dl-syscalls.h:3,
  from ./ldso/include/dl-syscall.h:12,
  from ./ldso/include/ldso.h:36,
  from ldso/ldso/ldso.c:33:
  ./libpthread/linuxthreads.old/sysdeps/sh/pt-machine.h:36: warning: C99 
 inline functions are not supported; using GNU89
  ./libpthread/linuxthreads.old/sysdeps/sh/pt-machine.h:36: warning: to 
 disable this warning use -fgnu89-inline or the gnu_inline function attribute

This needs fixing anyway. See the patch in my buildroot repo.
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc


Re: [PATCH] Always inline system calls

2007-12-04 Thread Carmelo AMOROSO
Bernhard Fischer wrote:
 On Tue, Dec 04, 2007 at 08:36:31AM +0100, Carmelo AMOROSO wrote:
   
 Paul Mundt wrote:
 
 On Mon, Dec 03, 2007 at 10:33:39PM +0100, Carmelo Amoroso wrote:
   
   
 Carmelo Amoroso wrote:
 while doing some test for SH4 to measure size increase for 'always inline' 
 changes,
 doscovered suddenly that gcc-4.1.1 (cross sh4) fails with the following 
 error:

 ../ldso/ldso/dl-elf.c: In function '_dl_dprintf':
 ../ldso/ldso/dl-elf.c:858: error: unable to find a register to spill in 
 class 'R0_REGS'
 ../ldso/ldso/dl-elf.c:858: error: this is the insn:
 (insn 916 917 24 1 (set (reg/f:SI 1 r1 [219])
  (mem/u/c:SI (plus:SI (reg:SI 12 r12)
  (reg/f:SI 1 r1 [220])) [0 S4 A32])) 172 {movsi_ie} (nil)
  (expr_list:REG_DEAD (reg/f:SI 1 r1 [220])
  (expr_list:REG_EQUIV (symbol_ref:SI (_dl_pagesize) var_decl 
 0x313a720 _dl_pagesize)
  (nil

 either running with -Os or -O0.
 I'll test tomorrow with gcc-4.2.1 to see if it makes difference,
 otherwise I suspect we should go back on my proposal in using always inline
 only for arch strictly requiring it.

 
 
 We've noticed this with some versions in buildroot also, so it seems to
 be a more common issue:

   
   
 Indeed at home I have gcc from buildroot. Tested just now at office 
 using gcc-4.2.1 from STMicro toolchain
 and it works fine, either using -O0 or -Os.
 I'll try to update buildroot at home with gcc 4.2.1 as well and see if 
 it solves.
 I'll keep you informed.

 Cheers,
 Carmelo
 
  CC ldso/ldso/ldso.oS
   In file included from 
 ./libpthread/linuxthreads.old/sysdeps/sh/tls.h:23,
 from ./include/bits/uClibc_errno.h:35,
 from ./include/errno.h:62,
 from ./include/bits/syscalls.h:16,
 from ./include/sys/syscall.h:34,
 from ./ldso/ldso/sh/dl-syscalls.h:3,
 from ./ldso/include/dl-syscall.h:12,
 from ./ldso/include/ldso.h:36,
 from ldso/ldso/ldso.c:33:
 ./libpthread/linuxthreads.old/sysdeps/sh/pt-machine.h:36: warning: C99 
 inline functions are not supported; using GNU89
 ./libpthread/linuxthreads.old/sysdeps/sh/pt-machine.h:36: warning: to 
 disable this warning use -fgnu89-inline or the gnu_inline function attribute
   

 This needs fixing anyway. See the patch in my buildroot repo.

   
Hi Bernd,
could you provide the link... searching among gcc4.1.1 patches from 
buildroot svn
I did find something related to this.

Carmelo
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc


Re: [PATCH] Always inline system calls

2007-12-04 Thread Bernhard Fischer
On Tue, Dec 04, 2007 at 01:31:13PM +0100, Carmelo AMOROSO wrote:
 Bernhard Fischer wrote:
 On Tue, Dec 04, 2007 at 08:36:31AM +0100, Carmelo AMOROSO wrote:
   
 Paul Mundt wrote:
 
 On Mon, Dec 03, 2007 at 10:33:39PM +0100, Carmelo Amoroso wrote:
 
 Carmelo Amoroso wrote:
 while doing some test for SH4 to measure size increase for 'always 
 inline' changes,
 doscovered suddenly that gcc-4.1.1 (cross sh4) fails with the following 
 error:

 ../ldso/ldso/dl-elf.c: In function '_dl_dprintf':
 ../ldso/ldso/dl-elf.c:858: error: unable to find a register to spill in 
 class 'R0_REGS'
 ../ldso/ldso/dl-elf.c:858: error: this is the insn:
 (insn 916 917 24 1 (set (reg/f:SI 1 r1 [219])
  (mem/u/c:SI (plus:SI (reg:SI 12 r12)
  (reg/f:SI 1 r1 [220])) [0 S4 A32])) 172 {movsi_ie} (nil)
  (expr_list:REG_DEAD (reg/f:SI 1 r1 [220])
  (expr_list:REG_EQUIV (symbol_ref:SI (_dl_pagesize) var_decl 
 0x313a720 _dl_pagesize)
  (nil

 either running with -Os or -O0.
 I'll test tomorrow with gcc-4.2.1 to see if it makes difference,
 otherwise I suspect we should go back on my proposal in using always 
 inline
 only for arch strictly requiring it.

 
 We've noticed this with some versions in buildroot also, so it seems to
 be a more common issue:

 
 Indeed at home I have gcc from buildroot. Tested just now at office using 
 gcc-4.2.1 from STMicro toolchain
 and it works fine, either using -O0 or -Os.
 I'll try to update buildroot at home with gcc 4.2.1 as well and see if it 
 solves.
 I'll keep you informed.

 Cheers,
 Carmelo
 
 CC ldso/ldso/ldso.oS
  In file included from 
 ./libpthread/linuxthreads.old/sysdeps/sh/tls.h:23,
from ./include/bits/uClibc_errno.h:35,
from ./include/errno.h:62,
from ./include/bits/syscalls.h:16,
from ./include/sys/syscall.h:34,
from ./ldso/ldso/sh/dl-syscalls.h:3,
from ./ldso/include/dl-syscall.h:12,
from ./ldso/include/ldso.h:36,
from ldso/ldso/ldso.c:33:
./libpthread/linuxthreads.old/sysdeps/sh/pt-machine.h:36: warning: C99 
 inline functions are not supported; using GNU89
./libpthread/linuxthreads.old/sysdeps/sh/pt-machine.h:36: warning: to 
 disable this warning use -fgnu89-inline or the gnu_inline function 
 attribute
   

 This needs fixing anyway. See the patch in my buildroot repo.

   
 Hi Bernd,
 could you provide the link... searching among gcc4.1.1 patches from 
 buildroot svn
 I did find something related to this.

http://repo.or.cz/w/buildroot.git?a=tree;f=toolchain/uClibc;hb=HEAD
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc


Re: [PATCH] Always inline system calls

2007-12-03 Thread Carmelo Amoroso
Hans-Christian Egtvedt wrote:
 On Tue, 2007-11-27 at 08:54 +0100, Joakim Tjernlund wrote:
 On Tue, 2007-11-27 at 08:31 +0100, Hans-Christian Egtvedt wrote:
 Haavard Skinnemoen wrote:
 On Fri, 16 Nov 2007 16:44:09 +0100
 Carmelo AMOROSO [EMAIL PROTECTED] wrote:

 Just an idea... why not redefining 'inline' into
 ldso/ldso/avr32/dl-syscalls.h that is included
 at the top of ldso/include/dl-syscall.h.
 This will not affect any other architectures, letting
 the compiler to do the best choice ?
 Are you sure no other architectures need this? gcc tends to get
 extremely reluctant about inlining when compiling with -Os, and I have
 a hard time believing that avr32 is the only architecture that can't
 call functions before the GOT has been initialized.

 Actually, we probably can call functions before the GOT has been set up
 if ldso is compiled with enough optimization, but I think it's more
 robust to just make sure that the functions that are called early are
 always inlined.

 This thread died, I can always make a patch for doing the inline stuff 
 only AVR32 specific. At least if others are seeing similar problems. For 
 example Buildroot will compile uClibc with -Os.
 I think always inline is better. As I recall there are some syscalls
 that must be inline or ldso will break for most archs

 
 Are there any architectures which break because of always inlining?
 
 Are there a huge difference in the binary size because of always inline?
 
Merged, cheers.
Carmelo
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc


Re: [PATCH] Always inline system calls

2007-12-03 Thread Carmelo Amoroso
Carmelo Amoroso wrote:
 Hans-Christian Egtvedt wrote:
 On Tue, 2007-11-27 at 08:54 +0100, Joakim Tjernlund wrote:
 On Tue, 2007-11-27 at 08:31 +0100, Hans-Christian Egtvedt wrote:
 Haavard Skinnemoen wrote:
 On Fri, 16 Nov 2007 16:44:09 +0100
 Carmelo AMOROSO [EMAIL PROTECTED] wrote:

 Just an idea... why not redefining 'inline' into
 ldso/ldso/avr32/dl-syscalls.h that is included
 at the top of ldso/include/dl-syscall.h.
 This will not affect any other architectures, letting
 the compiler to do the best choice ?
 Are you sure no other architectures need this? gcc tends to get
 extremely reluctant about inlining when compiling with -Os, and I have
 a hard time believing that avr32 is the only architecture that can't
 call functions before the GOT has been initialized.

 Actually, we probably can call functions before the GOT has been 
 set up
 if ldso is compiled with enough optimization, but I think it's more
 robust to just make sure that the functions that are called early are
 always inlined.

 This thread died, I can always make a patch for doing the inline 
 stuff only AVR32 specific. At least if others are seeing similar 
 problems. For example Buildroot will compile uClibc with -Os.
 I think always inline is better. As I recall there are some syscalls
 that must be inline or ldso will break for most archs


 Are there any architectures which break because of always inlining?

 Are there a huge difference in the binary size because of always inline?

 Merged, cheers.
 Carmelo
 

Hello,
while doing some test for SH4 to measure size increase for 'always inline' 
changes,
doscovered suddenly that gcc-4.1.1 (cross sh4) fails with the following error:

../ldso/ldso/dl-elf.c: In function '_dl_dprintf':
../ldso/ldso/dl-elf.c:858: error: unable to find a register to spill in class 
'R0_REGS'
../ldso/ldso/dl-elf.c:858: error: this is the insn:
(insn 916 917 24 1 (set (reg/f:SI 1 r1 [219])
 (mem/u/c:SI (plus:SI (reg:SI 12 r12)
 (reg/f:SI 1 r1 [220])) [0 S4 A32])) 172 {movsi_ie} (nil)
 (expr_list:REG_DEAD (reg/f:SI 1 r1 [220])
 (expr_list:REG_EQUIV (symbol_ref:SI (_dl_pagesize) var_decl 
0x313a720 _dl_pagesize)
 (nil

either running with -Os or -O0.
I'll test tomorrow with gcc-4.2.1 to see if it makes difference,
otherwise I suspect we should go back on my proposal in using always inline
only for arch strictly requiring it.

Carmelo
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc


Re: [PATCH] Always inline system calls

2007-12-03 Thread Khem Raj
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Carmelo Amoroso wrote:

 while doing some test for SH4 to measure size increase for 'always inline' 
 changes,
 doscovered suddenly that gcc-4.1.1 (cross sh4) fails with the following error:
 
 ../ldso/ldso/dl-elf.c: In function '_dl_dprintf':
 ../ldso/ldso/dl-elf.c:858: error: unable to find a register to spill in class 
 'R0_REGS'
 ../ldso/ldso/dl-elf.c:858: error: this is the insn:
 (insn 916 917 24 1 (set (reg/f:SI 1 r1 [219])
  (mem/u/c:SI (plus:SI (reg:SI 12 r12)
  (reg/f:SI 1 r1 [220])) [0 S4 A32])) 172 {movsi_ie} (nil)
  (expr_list:REG_DEAD (reg/f:SI 1 r1 [220])
  (expr_list:REG_EQUIV (symbol_ref:SI (_dl_pagesize) var_decl 
 0x313a720 _dl_pagesize)
  (nil
 
 either running with -Os or -O0.


It will be nice if you could reduce the testcase and report this problem
in gcc bugzilla.

 I'll test tomorrow with gcc-4.2.1 to see if it makes difference,
 otherwise I suspect we should go back on my proposal in using always inline
 only for arch strictly requiring it.
 
 Carmelo
 ___
 uClibc mailing list
 uClibc@uclibc.org
 http://busybox.net/cgi-bin/mailman/listinfo/uclibc


- --
Khem Raj
MontaVista Software Inc.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHVHpAUjbQJxVzeZQRAu/fAKCYlUCFUF8askPxhf9qhx4w6OYOVwCdE6Wq
i2blmWrXZaRbuGVYIpAQB2w=
=Ldww
-END PGP SIGNATURE-
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc


Re: [PATCH] Always inline system calls

2007-12-03 Thread Paul Mundt
On Mon, Dec 03, 2007 at 10:33:39PM +0100, Carmelo Amoroso wrote:
 Carmelo Amoroso wrote:
 while doing some test for SH4 to measure size increase for 'always inline' 
 changes,
 doscovered suddenly that gcc-4.1.1 (cross sh4) fails with the following error:
 
 ../ldso/ldso/dl-elf.c: In function '_dl_dprintf':
 ../ldso/ldso/dl-elf.c:858: error: unable to find a register to spill in class 
 'R0_REGS'
 ../ldso/ldso/dl-elf.c:858: error: this is the insn:
 (insn 916 917 24 1 (set (reg/f:SI 1 r1 [219])
  (mem/u/c:SI (plus:SI (reg:SI 12 r12)
  (reg/f:SI 1 r1 [220])) [0 S4 A32])) 172 {movsi_ie} (nil)
  (expr_list:REG_DEAD (reg/f:SI 1 r1 [220])
  (expr_list:REG_EQUIV (symbol_ref:SI (_dl_pagesize) var_decl 
 0x313a720 _dl_pagesize)
  (nil
 
 either running with -Os or -O0.
 I'll test tomorrow with gcc-4.2.1 to see if it makes difference,
 otherwise I suspect we should go back on my proposal in using always inline
 only for arch strictly requiring it.
 
We've noticed this with some versions in buildroot also, so it seems to
be a more common issue:

 CC ldso/ldso/ldso.oS
  In file included from 
./libpthread/linuxthreads.old/sysdeps/sh/tls.h:23,
from ./include/bits/uClibc_errno.h:35,
from ./include/errno.h:62,
from ./include/bits/syscalls.h:16,
from ./include/sys/syscall.h:34,
from ./ldso/ldso/sh/dl-syscalls.h:3,
from ./ldso/include/dl-syscall.h:12,
from ./ldso/include/ldso.h:36,
from ldso/ldso/ldso.c:33:
./libpthread/linuxthreads.old/sysdeps/sh/pt-machine.h:36: warning: C99 
inline functions are not supported; using GNU89
./libpthread/linuxthreads.old/sysdeps/sh/pt-machine.h:36: warning: to 
disable this warning use -fgnu89-inline or the gnu_inline function attribute
ldso/ldso/dl-elf.c: In function '_dl_dprintf':
ldso/ldso/dl-elf.c:803: error: unable to find a register to spill in 
class 'R0_REGS'
ldso/ldso/dl-elf.c:803: error: this is the insn:
(insn 884 885 23 3 (set (reg/f:SI 1 r1 [221])
(mem/u/c:SI (plus:SI (reg:SI 12 r12)
(reg/f:SI 1 r1 [222])) [0 S4 A32])) 171 {movsi_ie} (nil)
(expr_list:REG_DEAD (reg/f:SI 1 r1 [222])
(expr_list:REG_EQUIV (symbol_ref:SI (_dl_pagesize) 
var_decl 0x402d7660 _dl_pagesize)
(nil
ldso/ldso/dl-elf.c:803: confused by earlier errors, bailing out
make[1]: *** [ldso/ldso/ldso.oS] Error 1

So inlining itself may not really be a problem, but it might be worthwhile
hunting down the code that generates the immediate load and seeing if that can
be forced in to a memory access instead, so we avoid the R0 encoding dependence.
These are all in relation to _dl_pagesize at least.
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc


Re: [PATCH] Always inline system calls

2007-12-03 Thread Carmelo AMOROSO
Paul Mundt wrote:
 On Mon, Dec 03, 2007 at 10:33:39PM +0100, Carmelo Amoroso wrote:
   
 Carmelo Amoroso wrote:
 while doing some test for SH4 to measure size increase for 'always inline' 
 changes,
 doscovered suddenly that gcc-4.1.1 (cross sh4) fails with the following 
 error:

 ../ldso/ldso/dl-elf.c: In function '_dl_dprintf':
 ../ldso/ldso/dl-elf.c:858: error: unable to find a register to spill in 
 class 'R0_REGS'
 ../ldso/ldso/dl-elf.c:858: error: this is the insn:
 (insn 916 917 24 1 (set (reg/f:SI 1 r1 [219])
  (mem/u/c:SI (plus:SI (reg:SI 12 r12)
  (reg/f:SI 1 r1 [220])) [0 S4 A32])) 172 {movsi_ie} (nil)
  (expr_list:REG_DEAD (reg/f:SI 1 r1 [220])
  (expr_list:REG_EQUIV (symbol_ref:SI (_dl_pagesize) var_decl 
 0x313a720 _dl_pagesize)
  (nil

 either running with -Os or -O0.
 I'll test tomorrow with gcc-4.2.1 to see if it makes difference,
 otherwise I suspect we should go back on my proposal in using always inline
 only for arch strictly requiring it.

 
 We've noticed this with some versions in buildroot also, so it seems to
 be a more common issue:

   
Indeed at home I have gcc from buildroot. Tested just now at office 
using gcc-4.2.1 from STMicro toolchain
and it works fine, either using -O0 or -Os.
I'll try to update buildroot at home with gcc 4.2.1 as well and see if 
it solves.
I'll keep you informed.

Cheers,
Carmelo
CC ldso/ldso/ldso.oS
 In file included from 
 ./libpthread/linuxthreads.old/sysdeps/sh/tls.h:23,
   from ./include/bits/uClibc_errno.h:35,
   from ./include/errno.h:62,
   from ./include/bits/syscalls.h:16,
   from ./include/sys/syscall.h:34,
   from ./ldso/ldso/sh/dl-syscalls.h:3,
   from ./ldso/include/dl-syscall.h:12,
   from ./ldso/include/ldso.h:36,
   from ldso/ldso/ldso.c:33:
   ./libpthread/linuxthreads.old/sysdeps/sh/pt-machine.h:36: warning: C99 
 inline functions are not supported; using GNU89
   ./libpthread/linuxthreads.old/sysdeps/sh/pt-machine.h:36: warning: to 
 disable this warning use -fgnu89-inline or the gnu_inline function attribute
   ldso/ldso/dl-elf.c: In function '_dl_dprintf':
   ldso/ldso/dl-elf.c:803: error: unable to find a register to spill in 
 class 'R0_REGS'
   ldso/ldso/dl-elf.c:803: error: this is the insn:
   (insn 884 885 23 3 (set (reg/f:SI 1 r1 [221])
   (mem/u/c:SI (plus:SI (reg:SI 12 r12)
   (reg/f:SI 1 r1 [222])) [0 S4 A32])) 171 {movsi_ie} (nil)
   (expr_list:REG_DEAD (reg/f:SI 1 r1 [222])
   (expr_list:REG_EQUIV (symbol_ref:SI (_dl_pagesize) 
 var_decl 0x402d7660 _dl_pagesize)
   (nil
   ldso/ldso/dl-elf.c:803: confused by earlier errors, bailing out
   make[1]: *** [ldso/ldso/ldso.oS] Error 1

 So inlining itself may not really be a problem, but it might be worthwhile
 hunting down the code that generates the immediate load and seeing if that can
 be forced in to a memory access instead, so we avoid the R0 encoding 
 dependence.
 These are all in relation to _dl_pagesize at least.
 ___
 uClibc mailing list
 uClibc@uclibc.org
 http://busybox.net/cgi-bin/mailman/listinfo/uclibc

   

___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc


Re: [PATCH] Always inline system calls

2007-11-28 Thread Hans-Christian Egtvedt
On Tue, 2007-11-27 at 08:54 +0100, Joakim Tjernlund wrote:
 On Tue, 2007-11-27 at 08:31 +0100, Hans-Christian Egtvedt wrote:
  Haavard Skinnemoen wrote:
   On Fri, 16 Nov 2007 16:44:09 +0100
   Carmelo AMOROSO [EMAIL PROTECTED] wrote:
   
   Just an idea... why not redefining 'inline' into
   ldso/ldso/avr32/dl-syscalls.h that is included
   at the top of ldso/include/dl-syscall.h.
   This will not affect any other architectures, letting
   the compiler to do the best choice ?
   
   Are you sure no other architectures need this? gcc tends to get
   extremely reluctant about inlining when compiling with -Os, and I have
   a hard time believing that avr32 is the only architecture that can't
   call functions before the GOT has been initialized.
   
   Actually, we probably can call functions before the GOT has been set up
   if ldso is compiled with enough optimization, but I think it's more
   robust to just make sure that the functions that are called early are
   always inlined.
  
  
  This thread died, I can always make a patch for doing the inline stuff 
  only AVR32 specific. At least if others are seeing similar problems. For 
  example Buildroot will compile uClibc with -Os.
 
 I think always inline is better. As I recall there are some syscalls
 that must be inline or ldso will break for most archs


Are there any architectures which break because of always inlining?

Are there a huge difference in the binary size because of always inline?

-- 
With kind regards,
Hans-Christian Egtvedt, Applications Engineer

___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc


Re: [PATCH] Always inline system calls

2007-11-26 Thread Hans-Christian Egtvedt
Haavard Skinnemoen wrote:
 On Fri, 16 Nov 2007 16:44:09 +0100
 Carmelo AMOROSO [EMAIL PROTECTED] wrote:
 
 Just an idea... why not redefining 'inline' into
 ldso/ldso/avr32/dl-syscalls.h that is included
 at the top of ldso/include/dl-syscall.h.
 This will not affect any other architectures, letting
 the compiler to do the best choice ?
 
 Are you sure no other architectures need this? gcc tends to get
 extremely reluctant about inlining when compiling with -Os, and I have
 a hard time believing that avr32 is the only architecture that can't
 call functions before the GOT has been initialized.
 
 Actually, we probably can call functions before the GOT has been set up
 if ldso is compiled with enough optimization, but I think it's more
 robust to just make sure that the functions that are called early are
 always inlined.


This thread died, I can always make a patch for doing the inline stuff 
only AVR32 specific. At least if others are seeing similar problems. For 
example Buildroot will compile uClibc with -Os.

I will submit a patch soon (tm).

-- 
With kind regards,
Hans-Christian Egtvedt, Applications Enginer
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc


Re: [PATCH] Always inline system calls

2007-11-19 Thread Haavard Skinnemoen
On Fri, 16 Nov 2007 16:44:09 +0100
Carmelo AMOROSO [EMAIL PROTECTED] wrote:

 Just an idea... why not redefining 'inline' into
 ldso/ldso/avr32/dl-syscalls.h that is included
 at the top of ldso/include/dl-syscall.h.
 This will not affect any other architectures, letting
 the compiler to do the best choice ?

Are you sure no other architectures need this? gcc tends to get
extremely reluctant about inlining when compiling with -Os, and I have
a hard time believing that avr32 is the only architecture that can't
call functions before the GOT has been initialized.

Actually, we probably can call functions before the GOT has been set up
if ldso is compiled with enough optimization, but I think it's more
robust to just make sure that the functions that are called early are
always inlined.

HÃ¥vard
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc

Re: [PATCH] Always inline system calls

2007-11-16 Thread Hans-Christian Egtvedt
On Mon, 2007-10-29 at 17:01 +0100, Hans-Christian Egtvedt wrote:
 Hi,
 
 Some versions of gcc consider inline merely a hint. AVR32 depends on the
 system calls actually being inlined, so AVR32 needs to use
 __always_inline instead of just inline. The attached patch changes this
 for the system calls.


Bump

Since it is almost weekend (-:

-- 
With kind regards,
Hans-Christian Egtvedt, Applications Engineer

___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc


Re: [PATCH] Always inline system calls

2007-11-16 Thread Carmelo AMOROSO
Hans-Christian Egtvedt wrote:
 On Mon, 2007-10-29 at 17:01 +0100, Hans-Christian Egtvedt wrote:
   
 Hi,

 Some versions of gcc consider inline merely a hint. AVR32 depends on the
 system calls actually being inlined, so AVR32 needs to use
 __always_inline instead of just inline. The attached patch changes this
 for the system calls.

 

 Bump

 Since it is almost weekend (-:

   
Just an idea... why not redefining 'inline' into
ldso/ldso/avr32/dl-syscalls.h that is included
at the top of ldso/include/dl-syscall.h.
This will not affect any other architectures, letting
the compiler to do the best choice ?

Cheers,
Carmelo
___
uClibc mailing list
uClibc@uclibc.org
http://busybox.net/cgi-bin/mailman/listinfo/uclibc