DENX . DULG . UBootDoesntRunAfterUpgradingMyCompiler

14.2.10. U-Boot Doesn't Run after Upgrading my Compiler

I encountered a big problem that U-Boot 1.1.4 compiled by ELDK 4.1 for MPC82xx crashed.

But if I build it using gcc-3.4.6 based cross tools, U-Boot on my board boots correctly.

The same U-Boot code built by ELDK 4.1 (gcc-4.0) failed, nothing occurs on the serial port.

This is often a missing volatile attribute on shared variable references, particularly hardware registers. Newer compiler versions optimize more aggressively, making missing volatile attributes visible.

If you use -O0 (no optimization) does it fix the problem?
If it does, it most likely is an optimization/volatile issue. The hard part is figuring out where. Device handling and board-specific code is the place to start.

----- Revision r1.3 - 13 Dec 2008 - 19:53 - WolfgangDenk
Copyright © 2002-2020 by DENX Software Engineering