OSDN Git Service

* config/avr/avr.c (avr_case_values_threshold): Return 7.
authorgjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Jun 2012 18:32:25 +0000 (18:32 +0000)
committergjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Jun 2012 18:32:25 +0000 (18:32 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188336 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/avr/avr.c

index 19cbade..1026c90 100644 (file)
@@ -1,3 +1,7 @@
+2012-06-08  Georg-Johann Lay  <avr@gjlay.de>
+
+       * config/avr/avr.c (avr_case_values_threshold): Return 7.
+
 2012-06-07  Andreas Schwab  <schwab@linux-m68k.org>
 
        * genhooks.c (main): Set progname.
index 208f650..cd1a4af 100644 (file)
@@ -9419,12 +9419,20 @@ avr_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
     return false;
 }
 
-/* Worker function for CASE_VALUES_THRESHOLD.  */
+
+/* Implement `CASE_VALUES_THRESHOLD'.  */
+/* Supply the default for --param case-values-threshold=0  */
 
 static unsigned int
 avr_case_values_threshold (void)
 {
-  return (!AVR_HAVE_JMP_CALL || TARGET_CALL_PROLOGUES) ? 8 : 17;
+  /* The exact break-even point between a jump table and an if-else tree
+     depends on several factors not available here like, e.g. if 8-bit
+     comparisons can be used in the if-else tree or not, on the
+     range of the case values, if the case value can be reused, on the
+     register allocation, etc.  '7' appears to be a good choice.  */
+     
+  return 7;
 }