On Thu, Jun 6, 2013 at 7:40 PM, Alan Modra <amo...@gmail.com> wrote: > On Tue, Jun 04, 2013 at 11:45:12PM +0930, Alan Modra wrote: >> This patch allows the user to specify -mfp-in-toc/-msum-in-toc options >> without being overridden when -fsection-anchors or -mcmodel != small >> is in effect. I also change the default to -mno-fp-in-toc for >> -mcmodel=medium, because -mcmodel=medium ought to be able to address >> constants anywhere from the toc pointer, and putting them in their >> usual constant sections (.rodata.cst4 and .rodata.cst8) allow them to >> be merged at link time. For -mcmodel=large we keep the default as >> -mfp-in-toc because large code model requires a toc entry to address >> any constant outside the TOC. >> >> The patch also allows -mcmodel=medium toc relative addressing for >> CONSTANT_POOL_ADDRESS_P constants (the very sort we get from >> force_const_mem when -mno-fp-in-toc), and allows combine to merge the >> low-part of the address calculation with the load/store from memory. >> I'm not sure now why I had this disabled, perhaps there was a problem >> when we split toc refs early. Bootstrapped and regression tested >> powerpc64-linux. OK to apply? > > Revised patch. This one doesn't blindly trust CONSTANT_POOL_ADDRESS_P > constants are always sufficiently aligned. There are modes where > alignment is less than size, CQI, CHI, CSI, CDI, CTI, SC, DC, TC, so > it might be the case that the imaginary part of a complex constant > crossed a 32k boundary. > > I've also changed offsettable_ok_by_alignment to only check that the > particular access being considered doesn't cross a 32k boundary. > We'll only be offsetting within that access, so that is all that is > necessary. > > * config/rs6000/rs6000.c (rs6000_option_override_internal): Don't > override user -mfp-in-toc. > (offsettable_ok_by_alignment): Consider just the current access > rather than the whole object, unless BLKmode. Handle > CONSTANT_POOL_ADDRESS_P constants that lack a decl too. > (use_toc_relative_ref): Allow CONSTANT_POOL_ADDRESS_P constants > for -mcmodel=medium. > * config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Don't > override user -mfp-in-toc or -msum-in-toc. Default to > -mno-fp-in-toc for -mcmodel=medium.
Okay. It would have been helpful for reviewing the patch to submit the patch in two stages that separate the re-organization of the code from the modifications to the alignment test. Thanks, David