This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: simplify_shift_const() breaks sign extraction of wider sign-extension
- To: law at redhat dot com
- Subject: Re: simplify_shift_const() breaks sign extraction of wider sign-extension
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 03 Jan 2001 04:32:11 -0200
- Cc: gcc-patches at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <2405.978497917@upchuck>
On Jan 3, 2001, Jeffrey A Law <law@redhat.com> wrote:
>> * combine.c (simplify_shift_const): Even if we're sign-extracting,
>> don't discard an ASHIFTRT if we're shifting in a wider mode.
> This is OK if you add a comment to the code indicating why this
> transformation is not valid when RESULT_MODE is smaller than VAROP.
Ok, I've added the following to the comment above the test:
However, the sign
bit of a wider mode may be different from what would be
interpreted as the sign bit in a narrower mode, so, if
the result is narrower, don't discard the shift.
and I'm checking it in.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me