diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2010-02-05 15:47:02 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2010-02-05 15:47:02 +0000 |
commit | 2ad0ff16f7cee57d331450162ec1c2214af9792a (patch) | |
tree | f5808341b7a2da8c8f453dca8f637dd00e8029b3 /sim | |
parent | 6bbec505786239d3ebad084b673d19cc98a6c644 (diff) | |
download | gdb-2ad0ff16f7cee57d331450162ec1c2214af9792a.zip gdb-2ad0ff16f7cee57d331450162ec1c2214af9792a.tar.gz gdb-2ad0ff16f7cee57d331450162ec1c2214af9792a.tar.bz2 |
* ppc-instructions: Fix aliasing bugs when calling
invalid_arithemetic_operation.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/ppc/ChangeLog | 5 | ||||
-rw-r--r-- | sim/ppc/ppc-instructions | 31 |
2 files changed, 28 insertions, 8 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 85c20f2..f0476e4 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,8 @@ +2010-02-05 Andreas Schwab <schwab@linux-m68k.org> + + * ppc-instructions: Fix aliasing bugs when calling + invalid_arithemetic_operation. + 2009-11-13 Nathan Froyd <froydnj@codesourcery.com> * configure.ac: If build != host, create a separate build-config.h diff --git a/sim/ppc/ppc-instructions b/sim/ppc/ppc-instructions index b025f86..495fe62 100644 --- a/sim/ppc/ppc-instructions +++ b/sim/ppc/ppc-instructions @@ -3973,12 +3973,14 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, fpscr_vxsnan | fpscr_vximz, 0, /*single?*/ 0) /*negate?*/) { + union { double d; unsigned64 u; } tmp; invalid_arithemetic_operation(processor, cia, - (unsigned64*)&product, *frA, 0, *frC, + &tmp.u, *frA, 0, *frC, 0, /*instruction_is_frsp*/ 0, /*instruction_is_convert_to_64bit*/ 0, /*instruction_is_convert_to_32bit*/ 0); /*single-precision*/ + product = tmp.d; } else { /*HACK!*/ @@ -4018,12 +4020,14 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, fpscr_vxsnan | fpscr_vximz, 1, /*single?*/ 0) /*negate?*/) { + union { double d; unsigned64 u; } tmp; invalid_arithemetic_operation(processor, cia, - (unsigned64*)&product, *frA, 0, *frC, + &tmp.u, *frA, 0, *frC, 0, /*instruction_is_frsp*/ 0, /*instruction_is_convert_to_64bit*/ 0, /*instruction_is_convert_to_32bit*/ 0); /*single-precision*/ + product = tmp.d; } else { /*HACK!*/ @@ -4063,12 +4067,14 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, fpscr_vxsnan | fpscr_vximz, 0, /*single?*/ 0) /*negate?*/) { + union { double d; unsigned64 u; } tmp; invalid_arithemetic_operation(processor, cia, - (unsigned64*)&product, *frA, 0, *frC, + &tmp.u, *frA, 0, *frC, 0, /*instruction_is_frsp*/ 0, /*instruction_is_convert_to_64bit*/ 0, /*instruction_is_convert_to_32bit*/ 0); /*single-precision*/ + product = tmp.d; } else { /*HACK!*/ @@ -4108,12 +4114,14 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, fpscr_vxsnan | fpscr_vximz, 1, /*single?*/ 0) /*negate?*/) { + union { double d; unsigned64 u; } tmp; invalid_arithemetic_operation(processor, cia, - (unsigned64*)&product, *frA, 0, *frC, + &tmp.u, *frA, 0, *frC, 0, /*instruction_is_frsp*/ 0, /*instruction_is_convert_to_64bit*/ 0, /*instruction_is_convert_to_32bit*/ 0); /*single-precision*/ + product = tmp.d; } else { /*HACK!*/ @@ -4153,8 +4161,9 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, fpscr_vxsnan | fpscr_vximz, 0, /*single?*/ 0) /*negate?*/) { + union { double d; unsigned64 u; } tmp; invalid_arithemetic_operation(processor, cia, - (unsigned64*)&product, *frA, 0, *frC, + &tmp.u, *frA, 0, *frC, 0, /*instruction_is_frsp*/ 0, /*instruction_is_convert_to_64bit*/ 0, /*instruction_is_convert_to_32bit*/ @@ -4198,12 +4207,14 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, fpscr_vxsnan | fpscr_vximz, 1, /*single?*/ 0) /*negate?*/) { + union { double d; unsigned64 u; } tmp; invalid_arithemetic_operation(processor, cia, - (unsigned64*)&product, *frA, 0, *frC, + &tmp.u, *frA, 0, *frC, 0, /*instruction_is_frsp*/ 0, /*instruction_is_convert_to_64bit*/ 0, /*instruction_is_convert_to_32bit*/ 0); /*single-precision*/ + product = tmp.d; } else { /*HACK!*/ @@ -4243,12 +4254,14 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, fpscr_vxsnan | fpscr_vximz, 0, /*single?*/ 0) /*negate?*/) { + union { double d; unsigned64 u; } tmp; invalid_arithemetic_operation(processor, cia, - (unsigned64*)&product, *frA, 0, *frC, + &tmp.u, *frA, 0, *frC, 0, /*instruction_is_frsp*/ 0, /*instruction_is_convert_to_64bit*/ 0, /*instruction_is_convert_to_32bit*/ 0); /*single-precision*/ + product = tmp.d; } else { /*HACK!*/ @@ -4288,12 +4301,14 @@ void::function::invalid_zero_divide_operation:cpu *processor, unsigned_word cia, fpscr_vxsnan | fpscr_vximz, 1, /*single?*/ 0) /*negate?*/) { + union { double d; unsigned64 u; } tmp; invalid_arithemetic_operation(processor, cia, - (unsigned64*)&product, *frA, 0, *frC, + &tmp.u, *frA, 0, *frC, 0, /*instruction_is_frsp*/ 0, /*instruction_is_convert_to_64bit*/ 0, /*instruction_is_convert_to_32bit*/ 0); /*single-precision*/ + product = tmp.d; } else { /*HACK!*/ |