Linux/PPC gcc 2.95.2 - bad access generated when using inline func
Franz Sirl
Franz.Sirl-kernel@lauterbach.com
Wed Jun 28 02:51:00 GMT 2000
Hi Cort,
I'll look at your report in detail later today, in the meantime, can you
please try the new gcc-2.95.3-2c on
< ftp://devel.linuxppc.org/users/fsirl/R5/RPMS/ppc/ >? I've just finished
backporting a bunch of patches and maybe this one is already fixed.
Franz.
At 03:29 28.06.00, Cort Dougan wrote:
>GCC and system version
>---
>Reading specs from /usr/lib/gcc-lib/powerpc-unknown-linux-gnu/2.95.2/specs
>gcc version 2.95.2 19991024 (release)
>cort@medea<cort>$ uname -a
>Linux medea.fsmlabs.com 2.2.17pre5 #8 SMP Sun Jun 25 00:09:10 MDT 2000 ppc
>unknown
>
>GCC command line and files
>---
>gcc -I/sys/linux/include -I/sys/rtlinux/include
>-I/sys/rtlinux/include/compat -I/sys/rtlinux/include/posix -Wall
>-Wstrict-prototypes -O2 -g -D__RTL__ -D__KERNEL__ -DMODULE -D__powerpc__
>-fsigned-char -msoft-float -pipe -fno-builtin -ffixed-r2
>-Wno-uninitialized -mmultiple -mstring -DMODVERSIONS -include
>/sys/linux/include/linux/modversions.h -D__powerpc__ -c rtl_core.c -o
>rtl_core.o
>
>Preprocessed output is attached (rtl_core.i.bz2)
>
>I'm also attaching bitops.h and rtl_core.c.
>
>The problem
>---
>Calling change_bit() when it's an inline will cause a load from a bad
>address when change_bit() is called from a leaf function. If a call to a
>function (even an empty one) in the same function that calls change_bit()
>then no bad access happens.
>
>I switched the Linux/PPC bitops (file attached) to be inline rather than
>actual function calls. Now, RTLinux dies when I run it.
>
>The problem shows up in rtl_soft_cli() when it does a L_CLEAR() which is a
>define that does a change_bit() (which is now inline). As the function
>rtl_soft_cli() is now gcc produces asm that tries a load from a bad
>address. If I make rtl_soft_cli() a non-leaf function (by making a call to
>an empty function) the code runs without trouble. The only difference in
>the asm generated is the prologue/epilogue save/restore of some general
>purpose registers.
>
>I've checked the constraints in change_bit() and think they're correct. I
>included bitops.h in case they're not.
>
>I can provide the whole source tree for RTL (it's small) and a recipe to
>reproduce the problem and workaround if you need.
>
>
More information about the Gcc-bugs
mailing list