Re: Simulator bootloader fails with gcc 4

Stephane Eranian
2005-08-18T19:07:55Z

Tony,

On Thu, Aug 18, 2005 at 11:57:03AM -0700, Luck, Tony wrote:
> >Anyway, I looked quickly at the simulator code. I don't see anything
> >wrong on that side. On SSC_COMPLETION, you end up doing a byte by byte
> >memcpy for copyin for disk_stat and a byte by byte for copyout. Not much
> >could go wrong there. The definition for disk_stat is identical (w/o the
> >aligned attribute).
>
> Ah ... but gcc has an unpleasant habit of inlining memcpy() calls. This
> is really annoying when you have taken the trouble to replace code
> does a structure copy with an explicit call to memcpy() becuase
> you know that one of the source or destination is unaligned, only
> to have gcc generate some inline ld8/st8 instructions.

The simulator is not using the regular memcpy() routine it has its own
custom routine (which is not named memcpy).

--

-Stephane