-mfmovd enabled by default for SH2A but not for SH4
Kaz Kojima
kkojima@rr.iij4u.or.jp
Mon Feb 25 11:46:00 GMT 2008
"Naveen H.S." <naveen.hs@kpitcummins.com> wrote:
> Yes, we got this error on SH72513(SH2A) hardware. When the same code
> is run on simulator, the "address error" occurs on encountering the
> "fmov.d" instruction.
[snip]
> It is mentioned that "Double longword data accessed from other than
> double longword boundary" results in address error.
I thought that fmov.d does two long word accesses as Christian
has pointed out in his comment.
Anyway, the address error on the real hardware would suggest
that the double long word access occurs in your case.
Although one can explicitly provide his own fpscr setting as
Christian said and can use appropriate options, defaulting
-mdalign for TARGET_SH2A_DOUBLE might be more robust for users.
Could you please try the appended patch? Christian, how does
it look?
Regards,
kaz
--
* config/sh/sh.h (OVERRIDE_OPTIONS): Set MASK_ALIGN_DOUBLE
for TARGET_SH2A_DOUBLE.
--- ORIG/trunk/gcc/config/sh/sh.h 2007-12-07 09:11:38.000000000 +0900
+++ LOCAL/trunk/gcc/config/sh/sh.h 2008-02-25 19:09:48.000000000 +0900
@@ -553,7 +553,7 @@ do { \
{ \
sh_cpu = CPU_SH2A; \
if (TARGET_SH2A_DOUBLE) \
- target_flags |= MASK_FMOVD; \
+ target_flags |= MASK_FMOVD | MASK_ALIGN_DOUBLE; \
} \
if (TARGET_SH3) \
sh_cpu = CPU_SH3; \
More information about the Gcc
mailing list