# HG changeset patch # User jlarmour # Date 1083209998 0 # Node ID 003a3db955cdb05776ffc5f468f68b552fd73f9e # Parent b01860e43d549000ba77de66b0c6c80074e6ea12 * include/hal_arch.h (HAL_SET_GDB_FLOATING_POINT_REGISTERS): Make absolutely safe with respect to strict-aliasing. (HAL_SET_GDB_FLOATING_POINT_REGISTERS): Ditto. diff --git a/packages/hal/powerpc/arch/current/ChangeLog b/packages/hal/powerpc/arch/current/ChangeLog --- a/packages/hal/powerpc/arch/current/ChangeLog +++ b/packages/hal/powerpc/arch/current/ChangeLog @@ -1,3 +1,9 @@ +2004-04-29 Jonathan Larmour + + * include/hal_arch.h (HAL_SET_GDB_FLOATING_POINT_REGISTERS): Make + absolutely safe with respect to strict-aliasing. + (HAL_SET_GDB_FLOATING_POINT_REGISTERS): Ditto. + 2004-04-23 Gary Thomas * include/hal_arch.h: diff --git a/packages/hal/powerpc/arch/current/include/hal_arch.h b/packages/hal/powerpc/arch/current/include/hal_arch.h --- a/packages/hal/powerpc/arch/current/include/hal_arch.h +++ b/packages/hal/powerpc/arch/current/include/hal_arch.h @@ -13,6 +13,7 @@ // This file is part of eCos, the Embedded Configurable Operating System. // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. // Copyright (C) 2004 Gary Thomas +// Copyright (C) 2004 Jonathan Larmour // // eCos is free software; you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free @@ -270,7 +271,12 @@ typedef struct { // GDB ordered array. #define HAL_GET_GDB_REGISTERS( _aregval_, _regs_ ) \ CYG_MACRO_START \ - GDB_Registers *_gdb_ = (GDB_Registers *)((void *)(_aregval_)); \ + union __gdbreguniontype { \ + __typeof__(_aregval_) _aregval2_; \ + GDB_Registers *_gdbr; \ + } __gdbregunion; \ + __gdbregunion._aregval2_ = (_aregval_); \ + GDB_Registers *_gdb_ = __gdbregunion._gdbr; \ int _i_; \ \ for( _i_ = 0; _i_ < 32; _i_++ ) \ @@ -288,7 +294,12 @@ typedef struct { // Copy a GDB ordered array into a HAL_SavedRegisters structure. #define HAL_SET_GDB_REGISTERS( _regs_ , _aregval_ ) \ CYG_MACRO_START \ - GDB_Registers *_gdb_ = (GDB_Registers *)((void *)(_aregval_)); \ + union __gdbreguniontype { \ + __typeof__(_aregval_) _aregval2_; \ + GDB_Registers *_gdbr; \ + } __gdbregunion; \ + __gdbregunion._aregval2_ = (_aregval_); \ + GDB_Registers *_gdb_ = __gdbregunion._gdbr; \ int _i_; \ \ for( _i_ = 0; _i_ < 32; _i_++ ) \