This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix *two* AVR backend bugs (PR19293 + PR19329)
- From: Paul Schlie <schlie at comcast dot net>
- To: Bernardo Innocenti <bernie at develer dot com>
- Cc: Giovanni Bajo <rasky at develer dot com>,<denisc at overta dot ru>,Stefano Fedrigo <aleph at develer dot com>,Marek Michalkiewicz <marekm at amelek dot gda dot pl>,<gcc-patches at gcc dot gnu dot org>,Mark Mitchell <mark at codesourcery dot com>
- Date: Sun, 23 Jan 2005 20:17:25 -0500
- Subject: Re: [PATCH] Fix *two* AVR backend bugs (PR19293 + PR19329)
> From: Bernardo Innocenti <firstname.lastname@example.org>
> I agree. For all shift patterns, we should consistently:
> - return the input operand unchanged for shifts by 0;
> - do the right thing for shifts between 1 and N-1;
> - return 0 for out-of-range shifts;
> I will prepare an updated patch.
If you're not going to treat positive out-of-range shift as a no-op,
it might make sense to treat arithmetic right-shifts > mode-size as
equivalent to it's maximum valid arithmetic right-shift, thereby:
(((signed >> y) >> y) == ((signed) x >> (2 * y))
Thereby effectively saturating all positive shifts; but wonder if <= 0
shifts might be most efficiently handled as a no-op, i.e. logically only
shifting while count > 0 ?
(but still wonder if GCC things the cc is set for shifts of 0 if not