* sim/ppc: fix aliasing bugs
@ 2010-02-01 18:51 Andreas Schwab
2010-02-04 20:50 ` Tom Tromey
2010-02-14 10:01 ` Andreas Schwab
0 siblings, 2 replies; 3+ messages in thread
From: Andreas Schwab @ 2010-02-01 18:51 UTC (permalink / raw)
To: gdb-patches
invalid_arithemetic_operation expects a unsigned64*, but was passed a
double* or even float*.
Andreas.
2010-02-01 Andreas Schwab <schwab@linux-m68k.org>
* ppc-instructions: Fix aliasing bugs when calling
invalid_arithemetic_operation.
Index: sim/ppc/ppc-instructions
===================================================================
RCS file: /cvs/src/src/sim/ppc/ppc-instructions,v
retrieving revision 1.11
diff -u -a -p -r1.11 sim/ppc/ppc-instructions
--- sim/ppc/ppc-instructions 12 Jan 2009 20:04:36 -0000 1.11
+++ sim/ppc/ppc-instructions 1 Feb 2010 18:41:58 -0000
@@ -3973,12 +3973,14 @@ void::function::invalid_zero_divide_oper
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_oper
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_oper
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_oper
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_oper
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_oper
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_oper
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_oper
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!*/
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: sim/ppc: fix aliasing bugs
2010-02-01 18:51 sim/ppc: fix aliasing bugs Andreas Schwab
@ 2010-02-04 20:50 ` Tom Tromey
2010-02-14 10:01 ` Andreas Schwab
1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2010-02-04 20:50 UTC (permalink / raw)
To: Andreas Schwab; +Cc: gdb-patches
>>>>> "Andreas" == Andreas Schwab <schwab@linux-m68k.org> writes:
Andreas> 2010-02-01 Andreas Schwab <schwab@linux-m68k.org>
Andreas> * ppc-instructions: Fix aliasing bugs when calling
Andreas> invalid_arithemetic_operation.
This is ok. Thanks.
Tom
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: sim/ppc: fix aliasing bugs
2010-02-01 18:51 sim/ppc: fix aliasing bugs Andreas Schwab
2010-02-04 20:50 ` Tom Tromey
@ 2010-02-14 10:01 ` Andreas Schwab
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2010-02-14 10:01 UTC (permalink / raw)
To: gdb-patches
Accidentally left out an assignment.
Andreas.
2010-02-14 Andreas Schwab <schwab@linux-m68k.org>
* ppc-instructions: Fix missing assignment in last change.
Index: ppc-instructions
===================================================================
RCS file: /cvs/src/src/sim/ppc/ppc-instructions,v
retrieving revision 1.12
diff -u -a -p -r1.12 ppc-instructions
--- ppc-instructions 5 Feb 2010 15:47:02 -0000 1.12
+++ ppc-instructions 14 Feb 2010 09:56:11 -0000
@@ -4168,6 +4168,7 @@ void::function::invalid_zero_divide_oper
0, /*instruction_is_convert_to_64bit*/
0, /*instruction_is_convert_to_32bit*/
0); /*single-precision*/
+ product = tmp.d;
}
else {
/*HACK!*/
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-02-14 10:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-01 18:51 sim/ppc: fix aliasing bugs Andreas Schwab
2010-02-04 20:50 ` Tom Tromey
2010-02-14 10:01 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox