Hi,

On Thu, 24 Feb 2011, Jeff Law wrote:

> > Target avr suffers from similar problems in 4.3, 4.4 and 4.6 which are
> > all reported against avr backend, not against middleend/rtl optimizers.
> insn 33 and 34 are fine.  33 sets the high part of the HImode register
> to the result of the call to func1 and the low part is set to zero.
> This is effectively 256 * func1.
> 
> This has been the standard way to do things in GCC since, well, forever.
> 
> The docs seem to imply that assigning to a non-paradoxical subreg
> leaves the other part undefined -- that's simply not true and has never
> been true.

Funny.  As far back as I remember we consistently said that bits of the 
same word, but outside the subreg are left with undefined values after 
storing into the subreg, except if wrapped with a strict_low_part.  In 
fact that's the whole point of strict_low_part.  I'm pretty sure we assume 
this documented semantics in various parts of the compiler.

FWIW I've tried to trace back when these semantics were documented (in the 
hope of finding some more specific reasoning in mails or the like), but 
the oldest version of rtl.texi (not in SVN unfortunately, there it's 
r14676, checked in by you :), from 1997, probably egcs days), which is 
gcc-1.35/gcc.info-4 from 1989 (ahem :) ), already contains effectively the 
same language as today.  In any case, that's certainly the mode I was 
always working in: subreg writes clobber the whole word touched.


Ciao,
Michael.

Reply via email to