summaryrefslogtreecommitdiff
path: root/lib_nios
diff options
context:
space:
mode:
Diffstat (limited to 'lib_nios')
-rw-r--r--lib_nios/board.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib_nios/board.c b/lib_nios/board.c
index 30044f7..e6cda52 100644
--- a/lib_nios/board.c
+++ b/lib_nios/board.c
@@ -117,6 +117,9 @@ void board_init (void)
* Nios treats CFG_GBL_DATA_OFFSET as an address.
*/
gd = (gd_t *)CFG_GBL_DATA_OFFSET;
+ /* compiler optimization barrier needed for GCC >= 3.4 */
+ __asm__ __volatile__("": : :"memory");
+
memset( gd, 0, CFG_GBL_DATA_SIZE );
gd->bd = (bd_t *)(gd+1); /* At end of global data */