This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rtl-optimization]: Fix PR37997: ICE shifting byte to the right with constant > 7FFFFFFF
On Wed, 9 Sep 2009, Richard Guenther wrote:
> > ? ? ? ? ? ? /* We can shorten only if the shift count is less than the
> > ? ? ? ? ? ? ? ?number of bits in the smaller type size. ?*/
> > ? ? ? ? ? ? && compare_tree_int (op1, TYPE_PRECISION (TREE_TYPE (arg0))) < 0
> >
> > obviously overlooks the negative case.
>
> IMHO the frontend optimization is premature. It's the middle-ends
> job to do this kind of optimization.
I don't disagree that the existing shortening and other optimizations in
front ends should generally move out to fold, which in turn should be made
to operate after gimplification. But I don't think that has anything to
do with the RTL expanders needing to handle shift counts, constant or
nonconstant, of any integer type and mode.
--
Joseph S. Myers
joseph@codesourcery.com