On Tue, Jul 19, 2011 at 12:08 PM, Uros Bizjak <ubiz...@gmail.com> wrote: > On Tue, Jul 19, 2011 at 6:30 PM, Jakub Jelinek <ja...@redhat.com> wrote: > >>> Sometimes, the compiler is really creative in inventing instructions: >>> >>> (insn 47 46 49 7 (set (reg:SI 68 [ D.1686 ]) >>> (subreg:SI (plus:SF (reg:SF 159 [ D.1685 ]) >>> (reg:SF 159 [ D.1685 ])) 0)) omp_atomic1.f90:17 247 {*lea_2} >>> (expr_list:REG_DEAD (reg:SF 159 [ D.1685 ]) >>> (nil))) >>> >>> Really funny. >> >> That's the job of combiner to try all kinds of stuff and it is the >> responsibility of the backend to reject those. I think it would be better >> to get back to testing Pmode in the legitimate address hook, perhaps >> allowing ptr_mode too in addition to Pmode (which for -m32/-m64 won't mean >> any change, just for -mx32). > > I agree that we still need to check naked registers. However, for > 64bit targets it is OK to pass both, SImode and DImode registers. We > are sure that SImode values in DImode regs have top 32bits equal to 0 > in address calculations. This is not true for QImode regs (assignment > to lowpart only). We also have to prevent non-integer registers. > > Attached is my final version of the patch. >
It works fine. Can you check it in? Thanks. -- H.J.