> Now that Richi has fixed up SRA not to pessimize code by changing non-BLK > mode arguments into their BLKmode subparts, I think it would be nice > to fix up also the expansion of the BLKmode MEM_REFs that have non-BLKmode > non-addressable base decl. While this doesn't happen for this testcase > anymore, it rarely still occurs and I think it is wrong to expand > a BLKmode MEM_REF into a non-BLKmode rtx. While the callers sometimes > can cope with it, often they can't.
Another example is PR middle-end/51959, the BLKmode MEM_REF with non-BLKmode base is created by inlining, expanded to a DImode REG in expand_assignment and then sent to store_field, which attemps to spill it to memory but runs into an alias set conflict. I'll try to redirect it to the regular MEM_REF expander instead, so your patch might be a prerequisite. > Bootstrapped/regtested on x86_64-linux and i686-linux, bootstrapped on > powerpc64-linux (both --with-cpu=default32 and with real 64-bit > profiledbootstrap). Ok for trunk? > > 2012-01-19 Jakub Jelinek <ja...@redhat.com> > > PR middle-end/51895 > * expr.c (expand_expr_real_1): Handle BLKmode MEM_REF of > non-addressable non-BLKmode base correctly. > > * g++.dg/opt/pr51895.C: New test. I think that it should be applied. -- Eric Botcazou