Message ID | 20110829213244.GA17151@hungry-tiger.westford.ibm.com |
---|---|
State | New |
Headers | show |
On Mon, Aug 29, 2011 at 11:32 PM, Michael Meissner <meissner@linux.vnet.ibm.com> wrote: > David asked me to reverse the default for the -msave-toc-indirect option, since > it is buggy in a few cases, and in other places causes slowdowns if the > function has an early exit before calling the indrect function. I also > documented the switch. > > I did the usual bootstrap and make check with no regressions, and committed the > patch. Was this switch available in 4.6.x? If so please document the change of the default in gcc-4.7/changes.html. Thanks, Richard. > 2011-08-29 Michael Meissner <meissner@linux.vnet.ibm.com> > > * config/rs6000/rs6000.opt (-msave-toc-indirect): Change default > to off. Document switch. > * doc/invoke.texi (-msave-toc-indirect): Ditto. > > Index: gcc/config/rs6000/rs6000.opt > =================================================================== > --- gcc/config/rs6000/rs6000.opt (revision 178259) > +++ gcc/config/rs6000/rs6000.opt (working copy) > @@ -526,5 +526,5 @@ Target Report Var(TARGET_POINTERS_TO_NES > Use/do not use r11 to hold the static link in calls to functions via pointers. > > msave-toc-indirect > -Target Undocumented Var(TARGET_SAVE_TOC_INDIRECT) Save Init(1) > -; Control whether we save the TOC in the prologue for indirect calls or generate the save inline > +Target Report Var(TARGET_SAVE_TOC_INDIRECT) Save > +Control whether we save the TOC in the prologue for indirect calls or generate the save inline > Index: gcc/doc/invoke.texi > =================================================================== > --- gcc/doc/invoke.texi (revision 178259) > +++ gcc/doc/invoke.texi (working copy) > @@ -814,7 +814,8 @@ See RS/6000 and PowerPC Options. > -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol > -mno-recip-precision @gol > -mveclibabi=@var{type} -mfriz -mno-friz @gol > --mpointers-to-nested-functions -mno-pointers-to-nested-functions} > +-mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol > +-msave-toc-indirect -mno-save-toc-indirect} > > @emph{RX Options} > @gccoptlist{-m64bit-doubles -m32bit-doubles -fpu -nofpu@gol > @@ -16438,6 +16439,15 @@ static chain value to be loaded in regis > not be able to call through pointers to nested functions or pointers > to functions compiled in other languages that use the static chain if > you use the @option{-mno-pointers-to-nested-functions}. > + > +@item -msave-toc-indirect > +@itemx -mno-save-toc-indirect > +@opindex msave-toc-indirect > +Generate (do not generate) code to save the TOC value in the reserved > +stack location in the function prologue if the function calls through > +a pointer on AIX and 64-bit Linux systems. If the TOC value is not > +saved in the prologue, it is saved just before the call through the > +pointer. The @option{-mno-save-toc-indirect} option is the default. > @end table > > @node RX Options > > > -- > Michael Meissner, IBM > 5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA > meissner@linux.vnet.ibm.com fax +1 (978) 399-6899 >
On Tue, Aug 30, 2011 at 09:16:40AM +0200, Richard Guenther wrote: > On Mon, Aug 29, 2011 at 11:32 PM, Michael Meissner > <meissner@linux.vnet.ibm.com> wrote: > > David asked me to reverse the default for the -msave-toc-indirect option, since > > it is buggy in a few cases, and in other places causes slowdowns if the > > function has an early exit before calling the indrect function. I also > > documented the switch. > > > > I did the usual bootstrap and make check with no regressions, and committed the > > patch. > > Was this switch available in 4.6.x? If so please document the change of the > default in gcc-4.7/changes.html. No, the switch is not in the FSF 4.6 branch. When I first added it, I made the switch undocumented as a debugging switch, and I'm now documenting it. I will look to see if I need to update the 4.7 changes document.
Index: gcc/config/rs6000/rs6000.opt =================================================================== --- gcc/config/rs6000/rs6000.opt (revision 178259) +++ gcc/config/rs6000/rs6000.opt (working copy) @@ -526,5 +526,5 @@ Target Report Var(TARGET_POINTERS_TO_NES Use/do not use r11 to hold the static link in calls to functions via pointers. msave-toc-indirect -Target Undocumented Var(TARGET_SAVE_TOC_INDIRECT) Save Init(1) -; Control whether we save the TOC in the prologue for indirect calls or generate the save inline +Target Report Var(TARGET_SAVE_TOC_INDIRECT) Save +Control whether we save the TOC in the prologue for indirect calls or generate the save inline Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (revision 178259) +++ gcc/doc/invoke.texi (working copy) @@ -814,7 +814,8 @@ See RS/6000 and PowerPC Options. -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol -mno-recip-precision @gol -mveclibabi=@var{type} -mfriz -mno-friz @gol --mpointers-to-nested-functions -mno-pointers-to-nested-functions} +-mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol +-msave-toc-indirect -mno-save-toc-indirect} @emph{RX Options} @gccoptlist{-m64bit-doubles -m32bit-doubles -fpu -nofpu@gol @@ -16438,6 +16439,15 @@ static chain value to be loaded in regis not be able to call through pointers to nested functions or pointers to functions compiled in other languages that use the static chain if you use the @option{-mno-pointers-to-nested-functions}. + +@item -msave-toc-indirect +@itemx -mno-save-toc-indirect +@opindex msave-toc-indirect +Generate (do not generate) code to save the TOC value in the reserved +stack location in the function prologue if the function calls through +a pointer on AIX and 64-bit Linux systems. If the TOC value is not +saved in the prologue, it is saved just before the call through the +pointer. The @option{-mno-save-toc-indirect} option is the default. @end table @node RX Options