[U-Boot-Users] possible ELDK4 gcc compiler bug

Rune Torgersen runet at innovsys.com
Thu Dec 7 17:42:42 CET 2006

> -----Original Message-----
> From:  Matthias Fuchs
> *)FPGA_BA;
> Making 'fpga' static solves the problem. But why?

Making it volatile will solve it.

The reason is that the ctrl member is not used anywhere else (except for
some printf's) sothe compiler just strores the value in a register an
optimizes away the access to the datastructure (and your hardware). 
By making it volatile, you force the compiler to never optimize away the

BTW. your original code would probably have worked with -O0
optimizattion level.

More information about the U-Boot mailing list