Combine known_cond() may create subreg of const_int
Alexandre Oliva
aoliva@redhat.com
Thu Feb 14 12:12:00 GMT 2002
On Feb 12, 2002, Richard Henderson <rth@redhat.com> wrote:
> On Mon, Feb 11, 2002 at 08:58:50AM -0200, Alexandre Oliva wrote:
>> However, I wonder if it would be best to fold this logic into do_SUBST,
>> and/or to handle ZERO_EXTEND and SIGN_EXTEND similarly. Is this ok to
>> install?
> It would be good to handle zero/sign extend.
I went ahead and installed the approved patch, so that I could focus
on the ZERO_EXTEND/SIGN_EXTEND issue.
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?
I'm looking into how to handle the zero-extend case now.
> The option of hooking into do_SUBST is interesting, but I wonder if it'll
> sometimes be too late. That is, we'll have made some simplifications
> based on the value being 171, when it ought to have been the QImode -85.
I see. Agreed, such a problem is possible.
> Certainly we can put an assertion in do_SUBST that the replaced constant
> must match the mode of the thing it replaced. I wonder how many problems
> that will expose?
I'm looking into that. Any suggestions of targets on which you think
this is most likely to expose problems?
--
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