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

            Bug ID: 63984
           Summary: [5 Regression] ICE compiling kernel's
                    arch/x86/realmode/rm/wakemain.c
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sasha.levin at oracle dot com
                CC: rth at gcc dot gnu.org

Created attachment 34044
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34044&action=edit
Preprocessed source

I'm seeing the following:

$ gcc -v -nostdinc -isystem
/home/sasha/gcc-inst/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/include
-I./arch/x86/include -Iarch/x86/include/generated  -Iinclude
-I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I./include/uapi
-Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__
-I./arch/x86/include -Iarch/x86/include/generated -Iinclude
-I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I./include/uapi
-Iinclude/generated/uapi -include ./include/linux/kconfig.h -m16 -g -Os
-D__KERNEL__ -DDISABLE_BRANCH_PROFILING -Wall -Wstrict-prototypes -march=i386
-mregparm=3 -fno-strict-aliasing -c -o arch/x86/realmode/rm/.tmp_wakemain.o
arch/x86/realmode/rm/wakemain.i

Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/home/sasha/gcc-inst/ --with-arch=native
--with-tune=native --enable-languages=c --enable-lto --enable-gold
--enable-stage1-languages=c
Thread model: posix
gcc version 5.0.0 20141119 (experimental) (GCC) 

COLLECT_GCC_OPTIONS='-v' '-nostdinc' '-isystem'
'/home/sasha/gcc-inst/lib/gcc/x86_64-unknown-linux-gnu/5.0.0/include' '-I'
'./arch/x86/include' '-I' 'arch/x86/include/generated' '-I' 'include' '-I'
'./arch/x86/include/uapi' '-I' 'arch/x86/include/generated/uapi' '-I'
'./include/uapi' '-I' 'include/generated/uapi' '-include'
'./include/linux/kconfig.h' '-D' '__KERNEL__' '-I' './arch/x86/include' '-I'
'arch/x86/include/generated' '-I' 'include' '-I' './arch/x86/include/uapi' '-I'
'arch/x86/include/generated/uapi' '-I' './include/uapi' '-I'
'include/generated/uapi' '-include' './include/linux/kconfig.h' '-m16' '-g'
'-Os' '-D' '__KERNEL__' '-D' 'DISABLE_BRANCH_PROFILING' '-Wall'
'-Wstrict-prototypes' '-march=i386' '-mregparm=3' '-fno-strict-aliasing' '-c'
'-o' 'arch/x86/realmode/rm/.tmp_wakemain.o'
 /home/sasha/gcc-inst/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/cc1
-fpreprocessed arch/x86/realmode/rm/wakemain.i -quiet -dumpbase wakemain.i -m16
-march=i386 -mregparm=3 -auxbase-strip arch/x86/realmode/rm/.tmp_wakemain.o -g
-Os -Wall -Wstrict-prototypes -version -fno-strict-aliasing -o /tmp/ccWnGBzY.s
GNU C (GCC) version 5.0.0 20141119 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 5.0.0 20141119 (experimental), GMP version
5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C (GCC) version 5.0.0 20141119 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 5.0.0 20141119 (experimental), GMP version
5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: d04643349a41d5027a15b8bfd01906cd
In file included from arch/x86/realmode/rm/wakemain.c:2:0:
./arch/x86/boot/boot.h:340:6: warning: conflicting types for built-in function
‘puts’
 void puts(const char *);
      ^
./arch/x86/boot/boot.h:341:6: warning: conflicting types for built-in function
‘putchar’ 
 void putchar(int);
      ^
arch/x86/realmode/rm/wakemain.c:64:6: warning: return type of ‘main’ is not
‘int’ [-Wmain]
 void main(void)
      ^
arch/x86/realmode/rm/wakemain.c: In function ‘main’:
arch/x86/realmode/rm/wakemain.c:82:1: internal compiler error: in
ix86_expand_prologue, at config/i386/i386.c:11347
 }
 ^
0xda1444 ix86_expand_prologue()
        ../../gcc/config/i386/i386.c:11347
0xe8da4a gen_prologue()
        ../../gcc/config/i386/i386.md:12095
0x84c6dd thread_prologue_and_epilogue_insns()
        ../../gcc/function.c:5911
0x84cff2 rest_of_handle_thread_prologue_and_epilogue
        ../../gcc/function.c:6481
0x84cff2 execute
        ../../gcc/function.c:6519
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.


I've bisected the issue down to:

commit f91f80127835aee6c888a0f9675702702ed781e8  
Author: rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>  
Date:   Wed Nov 19 13:30:34 2014 +0000  

    Make TARGET_STATIC_CHAIN allow a function type  

    As opposed to always being a decl.  This is a prerequisite  
    to allowing the static chain to be loaded for indirect calls.  

            * targhooks.c (default_static_chain): Remove check for  
            DECL_STATIC_CHAIN.  
            * config/moxie/moxie.c (moxie_static_chain): Likewise.  
            * config/i386/i386.c (ix86_static_chain): Allow decl or type  
            as the first argument.  
            * config/xtensa/xtensa.c (xtensa_static_chain): Change the name  
            of the unused first parameter.  
            * doc/tm.texi (TARGET_STATIC_CHAIN): Document the first parameter  
            may be a type.  
            * target.def (static_chain): Likewise.  

    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217769
138bc75d-0d04-0410-961f-82ee72b054a4


The preprocessed source file in question is attached.

Reply via email to