http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57439

--- Comment #4 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
Created attachment 30209
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30209&action=edit
experimental patch

I've used -I to point the compiler to the include directory in the newlib
sources, and from what I see them, the problem is that a narrow register
is generated by using the original REGNO and the new narrow mode - this
misses the big endian correction.

This patch uses gen_lowpart_common, which should just DTRT regardless of
endianness.

A further observation is that previously a conversion to a DImode add of 4 was
tried, and abandoned, presumably due to cost.  A SImode add to the 32 bit
lowpart
would be more profitable, at least if the target supports addq.l .
In general, we should try if a set or constant add with a destination that is
a subreg that constitutes one (or more) full hard register(s) is the cheapest
option.

Reply via email to