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: "David S. Miller" <davem at dm dot cobaltmicro dot com>
- Subject: Re: Your change to function.c
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 06 Oct 1998 00:10:20 -0600
- cc: rth at cygnus dot com, mark at markmitchell dot com, egcs-patches at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199810060512.WAA09623@dm.cobaltmicro.com>you write:
> 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.
You were missing a MEM in your previous message. It makes a lot more sense
now :-)
jeff