On 06/01/2011 04:00 PM, Georg-Johann Lay wrote: > Eric Botcazou schrieb: >>> You are right, I was staring at the wrong place. subreg of hardreg >>> should not be there. >> >> You can take a look at PR target/48830, this is a related problem for the >> SPARC where reload generates: >> >> (set (reg:SI 708 [ D.2989+4 ]) >> (subreg:SI (reg:DI 72 %f40) 4)) >> >> and (subreg:SI (reg:DI 72 %f40) 4) isn't simplifiable either. H.P. wrote a >> tentative patch for the subreg machinery to forbid this. Other references >> are: >> http://gcc.gnu.org/ml/gcc-patches/2008-07/msg01688.html >> http://gcc.gnu.org/ml/gcc-patches/2008-08/msg01743.html > > The problems is that find_reloads generates the wrong reload type. > > It sets the reload_type of "=" operands to RELOAD_WRITE. But for > subregs as above, there are bits between inner mode and outer mode > that already contain meaningful data and that data isn't wiped out by > writing to the subreg (because outer mode is > word_mode). > > Thus, a patch could look like that: [...] > Is this a reasonable fix?
I don't really think so. You'll need to find out where the subreg of a hard register was made and stop it from doing that. Bernd