This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [csl-sol210] Patch to add -fno-jump-tables
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Joern RENNECKE <joern dot rennecke at st dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 23 May 2005 18:44:37 +0000 (UTC)
- Subject: Re: [csl-sol210] Patch to add -fno-jump-tables
- References: <42921378.4090509@st.com>
On Mon, 23 May 2005, Joern RENNECKE wrote:
> > #ifndef ASM_OUTPUT_ADDR_DIFF_ELT
> > || 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
> ASM_OUTPUT_ADDR_DIFF_ELT.
> 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 http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
joseph@codesourcery.com (CodeSourcery mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)