This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Your change to function.c
- To: law at cygnus dot com
- Subject: Re: Your change to function.c
- From: "David S. Miller" <davem at dm dot cobaltmicro dot com>
- Date: Mon, 5 Oct 1998 22:12:44 -0700
- CC: rth at cygnus dot com, mark at markmitchell dot com, egcs-patches at cygnus dot com
- References: <5352.907599255@hurl.cygnus.com>
Date: Mon, 05 Oct 1998 08:54:15 -0600
From: Jeffrey A Law <law@cygnus.com>
> (set (reg:QI) (addressof:SI (reg:SF xxx)))
But why would we ever want to get something like the above -- addressof is
an address right? Why would we ever look at it in a mode like QImode?
What am I missing?
Look at the RTL you get while compiling libchill, specifically
format.c:inpconv(). The address of a float is taken, and cast to a
char pointer, and 4 bytes are picked out of it by the MOV4() macro.
The relevant stuff is:
#define MOV4(tgt,src) \
*((char*)(tgt) ) = *((char*)(src) ), \
*((char*)(tgt)+1) = *((char*)(src)+1), \
*((char*)(tgt)+2) = *((char*)(src)+2), \
*((char*)(tgt)+3) = *((char*)(src)+3)
float fval;
MOV4(io.__t.__locreal,&fval);
Look at what purge_addressof_1 looks at when this is compiled. It
look at something resembling:
(insn 18 15 19 (set (reg:QI 110)
(mem:QI (addressof:SI (reg:SF 108) 107) 0)) -1 (nil)
(nil))
And this is the source of the problem cases on big endian.
Later,
David S. Miller
davem@dm.cobaltmicro.com