This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [csl-sol210] Patch to add -fno-jump-tables

On Mon, 23 May 2005, Joern RENNECKE wrote:

> >  	       || flag_pic
> >  #endif
> > +	       || !flag_jump_tables
> >  	       || TREE_CONSTANT (index_expr))
> >  	{
> >  	  index = expand_expr (index_expr, NULL_RTX, VOIDmode, 0);
> This might not matter as long as you keep this on a sparc-only branch, but
> the !flag_jump_tables check should be inside the  #ifndef
> Targets like the SH can do casesi expansion just fine without requiring a GOT
> for that.

Sparc defines ASM_OUTPUT_ADDR_DIFF_ELT - that's why it's not enough for 
the dynamic linker to be compiled with -fPIC, because it can still use 
jump tables (of differences of addresses) with -fPIC, but not without a 
GOT because then the address of the jump table itself cannot be 
referenced.  The option only makes sense outside the #ifndef, because 
inside the #ifndef it would only be used on platforms where -fPIC by 
itself disables jump tables.

The flag -fno-jump-tables does what it says - disables jump tables.  
There's no need for anyone to use this flag on SH if the flag isn't needed 
on SH.  Perhaps the documentation should say "On some targets, jump tables 
do not require a GOT and this option is not needed."?

Joseph S. Myers      (personal mail) (CodeSourcery mail) (Bugzilla assignments and CCs)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]