From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dirk Behme Date: Sat, 15 Sep 2007 07:44:37 +0200 Subject: [U-Boot-Users] [PATCH] [ARM] Fix DECLARE_GLOBAL_DATA_PTR and make gd global Message-ID: <46EB7145.1050307@googlemail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 Signed-off-by: Dirk Behme [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