On Tue, Dec 10, 2013 at 8:05 AM, Kirill Yukhin <kirill.yuk...@gmail.com> wrote: > On 09 Dec 14:08, H.J. Lu wrote: >> >> There are no regressions on Linux/x86-64 with -m32 and -m64. >> Can you check if it improves code quality on x886? > > As second thought. If Tejas and Richard are right and it is simply incorrect > to check any offsets in this hook, may be we can end up with patch in the > bottom?
What is wrong to pass the correct offset to CANNOT_CHANGE_MODE_CLASS? Backends are free to ignore it. > > Test is passing (however I still don't know how to prohibit it for 32 bit > x86), > bootstrap in progress. > > Ideas? > > This change belongs to rth. > > -- > Thanks, K > > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index 382f8fb..0d0bb67 100644 > --- a/gcc/config/i386/i386.c > +++ b/gcc/config/i386/i386.c > @@ -35002,22 +35002,13 @@ ix86_cannot_change_mode_class (enum machine_mode > from, enum machine_mode to, > if (MAYBE_FLOAT_CLASS_P (regclass)) > return true; > > - if (MAYBE_SSE_CLASS_P (regclass) || MAYBE_MMX_CLASS_P (regclass)) > - { > - /* Vector registers do not support QI or HImode loads. If we don't > - disallow a change to these modes, reload will assume it's ok to > - drop the subreg from (subreg:SI (reg:HI 100) 0). This affects > - the vec_dupv4hi pattern. */ > - if (GET_MODE_SIZE (from) < 4) > - return true; > - > - /* Vector registers do not support subreg with nonzero offsets, which > - are otherwise valid for integer registers. Since we can't see > - whether we have a nonzero offset from here, prohibit all > - nonparadoxical subregs changing size. */ > - if (GET_MODE_SIZE (to) < GET_MODE_SIZE (from)) > - return true; > - } > + /* Vector registers do not support QI or HImode loads. If we don't > + disallow a change to these modes, reload will assume it's ok to > + drop the subreg from (subreg:SI (reg:HI 100) 0). This affects > + the vec_dupv4hi pattern. */ > + if ((MAYBE_SSE_CLASS_P (regclass) || MAYBE_MMX_CLASS_P (regclass)) > + && (GET_MODE_SIZE (from) < 4)) > + return true; > > You need to run full "make check" for both -m32 and -m64. -- H.J.