This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
expanding movdi into 2 x movsi
- From: "Jan Hoogerbrugge" <hoogerbrugge at hotmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 22 Apr 2004 14:25:50 +0200
- Subject: expanding movdi into 2 x movsi
- Bcc:
Hi,
I don't define movdi in my target description and so far I had the
impression that gcc was handling that for me by expanding a movdi into 2
movsi's. However, this does not seem to work perfectly. The following case
shows it:
struct O
{
struct O *addr;
long type;
};
extern struct O root;
struct O *foo()
{
struct O y, z;
z = *root.addr;
z = *(z.addr);
return z.addr;
}
The resulting code for the body is:
.text
.global _foo
_foo:
.function
ld32 r5 -> r5
ijmpf r0 r2
.endfunction
As you can see the reference to the global variable root has disappeared.
The problem disappears whenever I remove the type field from the struct.
This makes that the struct becomes a SImode instead of a DImode. Also, it
disappears whenever I rename the first assignment of z to y.
I this a gcc bug? Is there an easy workarond by defining a define_expand
"movdi" that maps the move to 2 SImode moves? Any suggestions for a port
where I can borrow some code from?
Jan
_________________________________________________________________
Hotmail en Messenger on the move
http://www.msn.nl/communicatie/smsdiensten/hotmailsmsv2/