Bug 55396 - -O2 -m32 -fno-omit-frame-pointer: internal compiler error: in check_rtl, at lra.c:2007
Summary: -O2 -m32 -fno-omit-frame-pointer: internal compiler error: in check_rtl, at l...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-19 19:49 UTC by Sebastian Andrzej Siewior
Modified: 2012-11-21 20:24 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
pre-processed file (242.18 KB, application/octet-stream)
2012-11-19 19:49 UTC, Sebastian Andrzej Siewior
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Andrzej Siewior 2012-11-19 19:49:08 UTC
Created attachment 28736 [details]
pre-processed file

Compiling the linux kernel ends with:

|kernel/sched/core.c: In function '__schedule':
|kernel/sched/core.c:2891:1: internal compiler error: in check_rtl, at lra.c:2007
| }
| ^

While removing Compiler options the ICE goes away if one of the following options 
is removed: "-O2 -m32 -fno-omit-frame-pointer"

gcc -v says:
Using built-in specs.
COLLECT_GCC=/usr/lib/gcc-snapshot/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 20121116-1' --with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs --enable-languages=c,ada,c++,java,go,fortran,objc,obj-c++ --prefix=/usr/lib/gcc-snapshot --enable-shared --enable-linker-build-id --with-system-zlib --disable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-snap/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-snap --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-snap --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --with-arch-32=i586 --with-abi=m64 --with-multilib-list=m32,m64 --with-tune=generic --disable-werror --enable-checking=yes --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.0 20121116 (experimental) [trunk revision 193562] (Debian 20121116-1)
Comment 1 Markus Trippelsdorf 2012-11-20 08:43:17 UTC
markus@x4 /tmp % cat test.i
int a[0];
struct thread_struct
{
    int sp;
    int ip;
}
;
struct task_struct
{
    struct thread_struct thread;
    struct task_struct *curr;
}
b, h, *l;
int c, d, e, f, g, m;
void
fn1 ()
{
    struct task_struct *i;
    int *j;
    int k;
need_resched:
    k = 0;
    h = *(typeof (&b)) a[k];
    j = 0;
    i = 0;
    ++*j;
    struct task_struct *n = i;
    asm ("popl %%ebp\n\t" : "=c" (d), "=d" (e), "=S" (f),
         "=D" (g):[next_sp] "mm" (n->thread.ip), [prev] "ad" (0));
    goto need_resched;
}

markus@x4 /tmp % gcc -O2 -c -m32 -fno-omit-frame-pointer test.i
test.i: In function ‘fn1’:
test.i:31:1: error: unrecognizable insn:
 }
 ^
(insn 25 47 26 3 (parallel [
            (set (reg:SI 2 cx [77])
                (asm_operands:SI ("popl %%ebp
        ") ("=c") 0 [
                        (mem:SI (plus:SI (reg:SI 2 cx [88])
                                (const_int 4 [0x4])) [2 MEM[(struct task_struct *)0B].thread.ip+0 S4 A32])
                        (reg:SI 2 cx [88])
                    ]
                     [
                        (asm_input:SI ("mm") (null):0)
                        (asm_input:SI ("ad") (null):0)
                    ]
                     [] test.i:28))
            (set (reg:SI 1 dx [78])
                (asm_operands:SI ("popl %%ebp
        ") ("=d") 1 [
                        (mem:SI (plus:SI (reg:SI 2 cx [88])
                                (const_int 4 [0x4])) [2 MEM[(struct task_struct *)0B].thread.ip+0 S4 A32])
                        (reg:SI 2 cx [88])
                    ]
                     [
                        (asm_input:SI ("mm") (null):0)
                        (asm_input:SI ("ad") (null):0)
                    ]
                     [] test.i:28))
            (set (reg:SI 4 si [79])
                (asm_operands:SI ("popl %%ebp
        ") ("=S") 2 [
                        (mem:SI (plus:SI (reg:SI 2 cx [88])
                                (const_int 4 [0x4])) [2 MEM[(struct task_struct *)0B].thread.ip+0 S4 A32])
                        (reg:SI 2 cx [88])
                    ]
                     [
                        (asm_input:SI ("mm") (null):0)
                        (asm_input:SI ("ad") (null):0)
                    ]
                     [] test.i:28))
            (set (reg:SI 5 di [80])
                (asm_operands:SI ("popl %%ebp
        ") ("=D") 3 [
                        (mem:SI (plus:SI (reg:SI 2 cx [88])
                                (const_int 4 [0x4])) [2 MEM[(struct task_struct *)0B].thread.ip+0 S4 A32])
                        (reg:SI 2 cx [88])
                    ]
                     [
                        (asm_input:SI ("mm") (null):0)
                        (asm_input:SI ("ad") (null):0)
                    ]
                     [] test.i:28))
            (clobber (reg:QI 18 fpsr))
            (clobber (reg:QI 17 flags))
        ]) test.i:28 -1
     (expr_list:REG_DEAD (reg:SI 2 cx [88])
        (nil)))
test.i:31:1: internal compiler error: in reload_cse_simplify_operands, at postreload.c:413
0x780d4a _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        /home/markus/gcc/gcc/rtl-error.c:110
0x780d79 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /home/markus/gcc/gcc/rtl-error.c:118
0x73bfbb reload_cse_simplify_operands
        /home/markus/gcc/gcc/postreload.c:413
0x73d52c reload_cse_simplify
        /home/markus/gcc/gcc/postreload.c:183
0x73d52c reload_cse_regs_1
        /home/markus/gcc/gcc/postreload.c:222
0x73d98b reload_cse_regs
        /home/markus/gcc/gcc/postreload.c:70
0x73d98b rest_of_handle_postreload
        /home/markus/gcc/gcc/postreload.c:2289
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 2 Vladimir Makarov 2012-11-20 21:33:12 UTC
Author: vmakarov
Date: Tue Nov 20 21:32:59 2012
New Revision: 193678

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193678
Log:
2012-11-20  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-optimization/55396
	* lra-constraints.c (get_reload_reg): Change class if it is
	different from reg class.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lra-constraints.c
Comment 3 Sebastian Andrzej Siewior 2012-11-21 20:24:54 UTC
(In reply to comment #2)
> Author: vmakarov
> Date: Tue Nov 20 21:32:59 2012
> New Revision: 193678

yup, that works. Thanks.

Sebastian