public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/64012] New: GCC-4.9.2 option -fcaller-saves in -O2
@ 2014-11-21  7:43 airbak.li at huawei dot com
  2014-11-21  7:47 ` [Bug middle-end/64012] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: airbak.li at huawei dot com @ 2014-11-21  7:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64012

            Bug ID: 64012
           Summary: GCC-4.9.2 option -fcaller-saves in -O2
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: airbak.li at huawei dot com

A cross toolchain build by GCC-4.9.2, when I use this toolchain to compile
kernel-3.4.35 with option -O2, it always crash when system power up.
(CPU : armv-7 cortex-a9)

-----------Crash log------------------------------
Unable to handle kernel paging request at virtual address ffffffff
pgd = c0004000
[ffffffff] *pgd=85ffe821, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] SMP ARM
Modules linked in:
CPU: 1    Not tainted  (3.4.35_hi3535 #27)
PC is at kmem_cache_alloc+0x54/0x130
LR is at con_insert_unipair+0xc0/0x10c
pc : [<c00a5764>]    lr : [<c028447c>]    psr: a0000013
sp : c5831e60  ip : c05b27d8  fp : c5831e94
r10: 00000263  r9 : 00000003  r8 : 0000005f
r7 : 0000005f  r6 : 000000d0  r5 : c5802200  r4 : ffffffff
r3 : 00000000  r2 : c5830000  r1 : c05a69e0  r0 : 0011e000
Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
Control: 10c53c7d  Table: 8000404a  DAC: 00000015
-------------Assembler code-------------------------
c00a5710 <kmem_cache_alloc>:
c00a5710:    e1a0c00d     mov    ip, sp
c00a5714:    e92ddff0     push    {r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc}
c00a5718:    e24cb004     sub    fp, ip, #4
c00a571c:    e24dd00c     sub    sp, sp, #12
c00a5720:    e1a0300d     mov    r3, sp
c00a5724:    e3c32d7f     bic    r2, r3, #8128    ; 0x1fc0
c00a5728:    e302c7d8     movw    ip, #10200    ; 0x27d8
c00a572c:    e3c2203f     bic    r2, r2, #63    ; 0x3f
c00a5730:    e34cc05b     movt    ip, #49243    ; 0xc05b
c00a5734:    e1a05000     mov    r5, r0
c00a5738:    e1a06001     mov    r6, r1
c00a573c:    e50be030     str    lr, [fp, #-48]    ; 0x30
c00a5740:    e5923014     ldr    r3, [r2, #20]
c00a5744:    e5951000     ldr    r1, [r5]
c00a5748:    e79c0103     ldr    r0, [ip, r3, lsl #2]
c00a574c:    e0813000     add    r3, r1, r0
c00a5750:    e593a004     ldr    sl, [r3, #4]
c00a5754:    e7914000     ldr    r4, [r1, r0]
c00a5758:    e3540000     cmp    r4, #0
c00a575c:    0a000026     beq    c00a57fc <kmem_cache_alloc+0xec>
c00a5760:    e5953014     ldr    r3, [r5, #20]
c00a5764:    e7949003     ldr    r9, [r4, r3]    --->r4 is ffffffff
c00a5768:    e10f8000     mrs    r8, CPSR
----------------------------------------------

When I compile kernel with "-O1" or "-O2 -fno-caller-saves", it is ok, no
crash.
(GCC-4.8 not have this problem)

Question:
1. Please tell me about option "-fcaller-saves" in GCC-4.9.2. Is it different
from GCC-4.8?

2. The error happen in code
"con_insert_unipair()->kmem_cache_alloc()->slab_alloc()", file path is
"linux-3.4.35\mm\slub.c".
What codes will "-fcaller-saves" optimize? Please give me some samples.

3."-fcaller-saves" may be not the root cause.
Generally, we use -O2 include "-fcaller-saves", we want to keep
"-fcaller-saves", please help me to solve it.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/64012] GCC-4.9.2 option -fcaller-saves in -O2
  2014-11-21  7:43 [Bug c/64012] New: GCC-4.9.2 option -fcaller-saves in -O2 airbak.li at huawei dot com
@ 2014-11-21  7:47 ` pinskia at gcc dot gnu.org
  2014-11-21  8:40 ` airbak.li at huawei dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-11-21  7:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64012

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |Arm-linux-gnueabi
          Component|c                           |middle-end

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't think fcaller-save made it into 4.9.  Can provide the output of gcc -v?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/64012] GCC-4.9.2 option -fcaller-saves in -O2
  2014-11-21  7:43 [Bug c/64012] New: GCC-4.9.2 option -fcaller-saves in -O2 airbak.li at huawei dot com
  2014-11-21  7:47 ` [Bug middle-end/64012] " pinskia at gcc dot gnu.org
@ 2014-11-21  8:40 ` airbak.li at huawei dot com
  2014-11-24  6:07 ` airbak.li at huawei dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: airbak.li at huawei dot com @ 2014-11-21  8:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64012

--- Comment #2 from Airbak <airbak.li at huawei dot com> ---
lijianhui@key:~$ arm-unknown-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-unknown-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/home/os/lijianhui/linaro/new-crosstool-ng/install-2-multilib/bin/../libexec/gcc/arm-unknown-linux-gnueabi/4.9.2/lto-wrapper
Target: arm-unknown-linux-gnueabi
Configured with:
/home/os/lijianhui/linaro/new-crosstool-ng/.build/src/gcc-linaro-4.9-2014.09/configure
--build=x86_64-build_unknown-linux-gnu --host=x86_64-build_unknown-linux-gnu
--target=arm-unknown-linux-gnueabi
--prefix=/home/os/lijianhui/linaro/new-crosstool-ng/install
--with-sysroot=/home/os/lijianhui/linaro/new-crosstool-ng/install/arm-unknown-linux-gnueabi/libc
--enable-languages=c,c++ --with-pkgversion='crosstool-NG 1.20.0 - Linaro GCC
4.9-2014.09' --with-bugurl=https://bugs.launchpad.net/gcc-linaro
--enable-__cxa_atexit --disable-libmudflap --enable-libgomp --disable-libssp
--disable-libquadmath --disable-libquadmath-support --disable-libsanitizer
--with-gmp=/home/os/lijianhui/linaro/new-crosstool-ng/.build/arm-unknown-linux-gnueabi/buildtools
--with-mpfr=/home/os/lijianhui/linaro/new-crosstool-ng/.build/arm-unknown-linux-gnueabi/buildtools
--with-mpc=/home/os/lijianhui/linaro/new-crosstool-ng/.build/arm-unknown-linux-gnueabi/buildtools
--with-isl=/home/os/lijianhui/linaro/new-crosstool-ng/.build/arm-unknown-linux-gnueabi/buildtools
--with-cloog=/home/os/lijianhui/linaro/new-crosstool-ng/.build/arm-unknown-linux-gnueabi/buildtools
--with-libelf=/home/os/lijianhui/linaro/new-crosstool-ng/.build/arm-unknown-linux-gnueabi/buildtools
--enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id
--enable-plugin --disable-nls
--with-local-prefix=/home/os/lijianhui/linaro/new-crosstool-ng/install/arm-unknown-linux-gnueabi/libc
--enable-c99 --enable-long-long --with-multilib-list=aprofile
--with-system-zlib
Thread model: posix
gcc version 4.9.2 20140904 (prerelease) (crosstool-NG 1.20.0 - Linaro GCC
4.9-2014.09)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/64012] GCC-4.9.2 option -fcaller-saves in -O2
  2014-11-21  7:43 [Bug c/64012] New: GCC-4.9.2 option -fcaller-saves in -O2 airbak.li at huawei dot com
  2014-11-21  7:47 ` [Bug middle-end/64012] " pinskia at gcc dot gnu.org
  2014-11-21  8:40 ` airbak.li at huawei dot com
@ 2014-11-24  6:07 ` airbak.li at huawei dot com
  2014-11-24  6:59 ` airbak.li at huawei dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: airbak.li at huawei dot com @ 2014-11-24  6:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64012

--- Comment #4 from Airbak <airbak.li at huawei dot com> ---
When I build toolchain with GNU <gcc-4.9.2.tar.bz2>, the problem also exist.

------------------
lijianhui@key:~/hi3535/Hi3535_SDK_V2.0.3.1/osdrv/kernel/linux-3.4.y$
arm-unknown-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-unknown-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/home/os/lijianhui/linaro/new-crosstool-ng/install-org-gcc/bin/../libexec/gcc/arm-unknown-linux-gnueabi/4.9.2/lto-wrapper
Target: arm-unknown-linux-gnueabi
Configured with: 
/home/os/lijianhui/linaro/new-crosstool-ng/.build/src/gcc-4.9.2/configure 
--build=x86_64-build_unknown-linux-gnu 
--host=x86_64-build_unknown-linux-gnu --target=arm-unknown-linux-gnueabi 
--prefix=/home/os/lijianhui/linaro/new-crosstool-ng/install 
...


Any suggestions?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/64012] GCC-4.9.2 option -fcaller-saves in -O2
  2014-11-21  7:43 [Bug c/64012] New: GCC-4.9.2 option -fcaller-saves in -O2 airbak.li at huawei dot com
                   ` (2 preceding siblings ...)
  2014-11-24  6:07 ` airbak.li at huawei dot com
@ 2014-11-24  6:59 ` airbak.li at huawei dot com
  2014-11-24  9:53 ` ebotcazou at gcc dot gnu.org
  2014-11-28  1:29 ` airbak.li at huawei dot com
  5 siblings, 0 replies; 7+ messages in thread
From: airbak.li at huawei dot com @ 2014-11-24  6:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64012

--- Comment #5 from Airbak <airbak.li at huawei dot com> ---
I'm sorry for my mistake. 
GCC-4.8.3 also have this phenomenon. GCC 4.4.1 is OK.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/64012] GCC-4.9.2 option -fcaller-saves in -O2
  2014-11-21  7:43 [Bug c/64012] New: GCC-4.9.2 option -fcaller-saves in -O2 airbak.li at huawei dot com
                   ` (3 preceding siblings ...)
  2014-11-24  6:59 ` airbak.li at huawei dot com
@ 2014-11-24  9:53 ` ebotcazou at gcc dot gnu.org
  2014-11-28  1:29 ` airbak.li at huawei dot com
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2014-11-24  9:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64012

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
   Last reconfirmed|                            |2014-11-24
                 CC|                            |ebotcazou at gcc dot gnu.org
         Resolution|INVALID                     |---
     Ever confirmed|0                           |1

--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> I don't think fcaller-save made it into 4.9.

You're confusing -fcaller-saves and -fuse-caller-saves here.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug middle-end/64012] GCC-4.9.2 option -fcaller-saves in -O2
  2014-11-21  7:43 [Bug c/64012] New: GCC-4.9.2 option -fcaller-saves in -O2 airbak.li at huawei dot com
                   ` (4 preceding siblings ...)
  2014-11-24  9:53 ` ebotcazou at gcc dot gnu.org
@ 2014-11-28  1:29 ` airbak.li at huawei dot com
  5 siblings, 0 replies; 7+ messages in thread
From: airbak.li at huawei dot com @ 2014-11-28  1:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64012

Airbak <airbak.li at huawei dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED
         Resolution|INVALID                     |FIXED

--- Comment #8 from Airbak <airbak.li at huawei dot com> ---
The problem is solved. Thanks.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-11-28  1:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-21  7:43 [Bug c/64012] New: GCC-4.9.2 option -fcaller-saves in -O2 airbak.li at huawei dot com
2014-11-21  7:47 ` [Bug middle-end/64012] " pinskia at gcc dot gnu.org
2014-11-21  8:40 ` airbak.li at huawei dot com
2014-11-24  6:07 ` airbak.li at huawei dot com
2014-11-24  6:59 ` airbak.li at huawei dot com
2014-11-24  9:53 ` ebotcazou at gcc dot gnu.org
2014-11-28  1:29 ` airbak.li at huawei dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).