On 12-10-29 12:21 PM, Richard Sandiford wrote: > Vladimir Makarov <vmaka...@redhat.com> writes: >> H.J. in >> >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55116 >> >> reported an interesting address >> >>> (and:DI (subreg:DI (plus:SI (ashift:SI (reg:SI 96 [ glob_vol_int.22 ]) >> (const_int 2 [0x2])) >> (symbol_ref:SI ("glob_vol_int_arr") <var_decl >> 0x7ffff03c2720 glob_vol_int_arr>)) 0) >> (const_int 4294967295 [0xffffffff])) >> >> which can not be correctly extracted. Here `and' with `subreg' >> behaves as an address mutation. >> >> The following patch fixes the problem. >> >> Ok to commit, Richard? > > Heh, I wondered if subregs might still be used like that, and was almost > tempted to add them just in case. > > I think this particular case is really a failed canonicalisation and that: > > (and:DI (subreg:DI (foo:SI ...) 0) (const_int 0xffffffff)) > > ought to be: > > (zero_extend:DI (foo:SI ...))
This canonicalisation would make my life much easier. Please note that (and:DI ((foo:DI ...) (const_int 0xffffffff))) is also valid address. We have tripped on it a couple of times with x32. Uros.