http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60624
Bug ID: 60624 Summary: creation of working linux sparc32 kernel fails Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: wbx at openadk dot org Hi, recently I updated my gcc 4.7.3 based cross-toolchain to 4.8.2. Since then my sparc32 kernel does not boot in qemu-system-sparc anymore. I used git bisect to find following commit, which breaks it: http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=190291 Bug fixed with this commit: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54109 When reverting the change in gcc 4.8.2, system boots up fine again. Can anybody explain me, why removing an optimization in gcc, breaks the Linux kernel bootup? You can find a working and a broken kernel on http://www.openadk.org/sparc including disassembled versions. The bug happens with at least 3.13.6, 3.12.13, 3.11.10, 3.10.33 and 3.4.82. Oops on boot with Qemu 1.7.0: qemu-system-sparc -M SS-5 -nographic -kernel vmlinux.broken: CPUs: 1 x FMI,MB86904 UUID: 00000000-0000-0000-0000-000000000000 Welcome to OpenBIOS v1.1 built on Oct 2 2013 22:57 Type 'help' for detailed information [sparc] Kernel already loaded switching to new context: PROMLIB: obio_ranges 1 PROMLIB: Sun Boot Prom Version 3 Revision 2 Linux version 3.13.6 (wbx@kop-brodkorbw) (gcc version 4.8.2 (GCC) ) #2 Sun Mar 23 12:11:57 CET 2014 bootconsole [earlyprom0] enabled ARCH: SUN4M TYPE: SPARCstation 5 Ethernet address: 52:54:00:12:34:56 OF stdout device is: /obio/zs@0,100000:a PROM: Built device tree with 22213 bytes of memory. Booting Linux... Power off control detected. Unable to handle kernel NULL pointer dereference tsk->{mm,active_mm}->context = ffffffff tsk->{mm,active_mm}->pgd = fc000000 \|/ ____ \|/ "@'/ ,. \`@" /_| \__/ |_\ \__U_/ swapper(0): Oops [#1] CPU: 0 PID: 0 Comm: swapper Not tainted 3.13.6 #2 task: f0251eb8 ti: f0248000 task.ti: f0248000 PSR: 04001fc4 PC: f026d9ec NPC: f026d9f0 Y: 00000000 Not tainted PC: <pcpu_setup_first_chunk+0x590/0x74c> %G: f03d2c58 000000ff 00000000 00000001 f0401000 0000075b f0248000 00000000 %O: 00000000 00000000 00000000 00000001 00000001 0000002c f0249e70 f026d9ac RPC: <pcpu_setup_first_chunk+0x550/0x74c> %L: f0250000 f0250000 00000000 f0250000 00000001 00000001 00000000 00000000 %I: f074fbe0 f0751000 00000008 f03d3000 00008000 f0759100 f0249ed0 f026dc1c Disabling lock debugging due to kernel taint Caller[f026dc1c]: setup_per_cpu_areas+0x74/0x98 Caller[f0263a68]: start_kernel+0x104/0x3cc Caller[f026343c]: continue_boot+0x324/0x334 Caller[f0263048]: execute_in_high_mem+0x48/0x98 Instruction DUMP: 82006001 8328c001 82007fff <c2208012> c2062004 80a06000 2280000b f8276008 c2276008 Kernel panic - not syncing: Attempted to kill the idle task! Press Stop-A (L1-A) to return to the boot prom Thanks for any help in advance. Waldemar