[U-Boot-Users] [PATCH] [ARM] Fix DECLARE_GLOBAL_DATA_PTR and make gd global

Dirk Behme dirk.behme at googlemail.com
Sat Sep 15 07:44:37 CEST 2007


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 at codesourcery.com>

Signed-off-by: Dirk Behme <dirk.behme at gmail.com>

[1]
http://linux.omap.com/pipermail/davinci-linux-open-source/2007-September/004068.html
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/004072.html

[3]
http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Local-Reg-Vars.html#Local-Reg-Vars

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: arm_global_data_pointer_patch.txt
Url: http://lists.denx.de/pipermail/u-boot/attachments/20070915/f342351a/attachment.txt 


More information about the U-Boot mailing list