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]

Re: simplify_shift_const() breaks sign extraction of wider sign-extension


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

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