summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-01 18:19:09 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-01 18:19:09 +0000
commit51d8e657d0087d91e4000f241de335121ea3810d (patch)
treec2f32333e3d90048910804ca1577c829154c8c3b
parent61ef64167ce0275c52cd71312c85692fdc3702da (diff)
downloadgcc-51d8e657d0087d91e4000f241de335121ea3810d.tar.gz
* common.opt (fjump-tables): New.
* doc/invoke.texi (-fno-jump-tables): Document. * stmt.c (expand_end_case_type): Do not emit jump tables unless flag_jump_tables. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100457 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/common.opt4
-rw-r--r--gcc/doc/invoke.texi10
-rw-r--r--gcc/stmt.c1
4 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 66269506c54..adfecf5de16 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2005-06-01 Joseph S. Myers <joseph@codesourcery.com>
+
+ * common.opt (fjump-tables): New.
+ * doc/invoke.texi (-fno-jump-tables): Document.
+ * stmt.c (expand_end_case_type): Do not emit jump tables unless
+ flag_jump_tables.
+
2005-06-01 Richard Earnshaw <richard.earnshaw@arm.com>
* arm.md (bunordered, bordered, bungt, bunlt, bunge, bunle, buneq)
diff --git a/gcc/common.opt b/gcc/common.opt
index 91cc3c1ccc2..a603707508a 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -488,6 +488,10 @@ fivopts
Common Report Var(flag_ivopts) Init(1)
Optimize induction variables on trees
+fjump-tables
+Common Var(flag_jump_tables) Init(1)
+Use jump tables for sufficiently large switch statements
+
fkeep-inline-functions
Common Report Var(flag_keep_inline_functions)
Generate code for functions even if they are fully inlined
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a6483e8eaa8..94c4b2ead7a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -732,6 +732,7 @@ See S/390 and zSeries Options.
-finhibit-size-directive -finstrument-functions @gol
-fno-common -fno-ident @gol
-fpcc-struct-return -fpic -fPIC -fpie -fPIE @gol
+-fno-jump-tables @gol
-freg-struct-return -fshared-data -fshort-enums @gol
-fshort-double -fshort-wchar @gol
-fverbose-asm -fpack-struct[=@var{n}] -fstack-check @gol
@@ -12582,6 +12583,15 @@ generated position independent code can be only linked into executables.
Usually these options are used when @option{-pie} GCC option will be
used during linking.
+@item -fno-jump-tables
+@opindex fno-jump-tables
+Do not use jump tables for switch statements even where it would be
+more efficient than other code generation strategies. This option is
+of use in conjunction with @option{-fpic} or @option{-fPIC} for
+building code which forms part of a dynamic linker and cannot
+reference the address of a jump table. On some targets, jump tables
+do not require a GOT and this option is not needed.
+
@item -ffixed-@var{reg}
@opindex ffixed
Treat the register named @var{reg} as a fixed register; generated code
diff --git a/gcc/stmt.c b/gcc/stmt.c
index d1e71dea4f1..6bdaf51b9db 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -2458,6 +2458,7 @@ expand_case (tree exp)
#ifndef ASM_OUTPUT_ADDR_DIFF_ELT
|| flag_pic
#endif
+ || !flag_jump_tables
|| TREE_CONSTANT (index_expr)
/* If neither casesi or tablejump is available, we can
only go this way. */