This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][RFC] Bit CCP and pointer alignment propagation


On Fri, 30 Jul 2010, Richard Henderson wrote:

> On 07/30/2010 06:15 AM, Richard Guenther wrote:
> > I think we can have negative shift counts (at least the constant folding
> > code suggests so), this is why I have the code as-is.
> 
> VAX has them; I can't recall any other target that does.
> 
> Almost all truncate the shift count at some bit position
> (sometimes at the largest supported shift count, e.g. 
> truncate to 6 bits even for a 32-bit shift because there
> exists a 64-bit shift; TARGET_SHIFT_TRUNCATION_MASK will
> tell you about this).
> 
> A very few actually check all bits of the value and treat
> very large (unsigned) shift counts as producing a zero.
> 
> It does seem like a large code burden to carry around just
> for one (or a few) targets, when instead we could simply
> treat the value as implementation-defined (varying in this
> case, unfolded in the other case).

Indeed.  We can just interpret the shift count as unsigned
(even forcing unsigned types in the middle-end for the
2nd operand of the shift and rotate codes).

Richard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]