Combine known_cond() may create subreg of const_int

Alexandre Oliva aoliva@redhat.com
Thu Feb 14 13:51:00 GMT 2002


On Feb 14, 2002, Richard Henderson <rth@redhat.com> wrote:

> On Thu, Feb 14, 2002 at 05:40:08PM -0200, Alexandre Oliva wrote:
>> Thinking some more about it, it appears that we actually only need to
>> handle ZERO_EXTEND, because SIGN_EXTEND is already taken care of by
>> the fact that: (i) in (sign_extend:M X), X's mode must be narrower
>> than M, and (ii) if X is a const_int, it's already a sign-extension
>> for the narrower mode, so it's implicitly a sign-extension for the
>> wider mode.  Agreed?

> You're expecting that 

> 	(set (reg:SI 101) (const_int 0x1ff))
> 	(set (reg:SI 102) (sign_extend:SI (subreg:QI (reg:SI 101) 0)))

> should be handled in two steps, with the subreg simplified first?

Yup.

> Yes, I can agree to that.

Cool!

>> I'm looking into that.  Any suggestions of targets on which you think
>> this is most likely to expose problems?

> No idea, really.

Well, I've already run into at least one bug on x86 :-)  Cool!

I'll post a patch as soon as I get to something that bootstraps.

-- 
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                Professional serial bug killer



More information about the Gcc-patches mailing list