
Some users [1] with (some?) ARM toolchains report issues with
#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
in include/asm-arm/global_data.h
The issue seems to be [2]
-- cut -- The gcc documentation [3] clearly states that local register variables are not guaranteed to contain the values you think they do, except in certain circumstances. In particular: "Stores into local register variables may be deleted when they appear to be dead according to dataflow analysis." -- cut --
This patch makes DECLARE_GLOBAL_DATA_PTR empty, so no local register variable any more, and makes gd global.
Original patch by Paul Brook paul@codesourcery.com
Signed-off-by: Dirk Behme dirk.behme@gmail.com
[1] http://linux.omap.com/pipermail/davinci-linux-open-source/2007-September/004... http://www.codesourcery.com/archives/arm-gnu/msg00736.html
[2] http://www.codesourcery.com/archives/arm-gnu/msg00741.html http://linux.omap.com/pipermail/davinci-linux-open-source/2007-September/004...
[3] http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Local-Reg-Vars.html#Local-Reg-Va...
Index: uboot_davinci/include/asm-arm/global_data.h =================================================================== --- uboot_davinci.orig/include/asm-arm/global_data.h +++ uboot_davinci/include/asm-arm/global_data.h @@ -61,6 +61,8 @@ typedef struct global_data { #define GD_FLG_DEVINIT 0x00002 /* Devices have been initialized */ #define GD_FLG_SILENT 0x00004 /* Silent mode */
-#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8") +#define DECLARE_GLOBAL_DATA_PTR + +register gd_t *gd asm ("r8");
#endif /* __ASM_GBL_DATA_H */