h8300.c (h8300_tiny_constant_address_p): Use a switch statement instead of a chain...
authorKazu Hirata <kazu@cs.umass.edu>
Mon, 26 Jan 2004 20:21:11 +0000 (20:21 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Mon, 26 Jan 2004 20:21:11 +0000 (20:21 +0000)
* config/h8300/h8300.c (h8300_tiny_constant_address_p): Use a
switch statement instead of a chain of if statements.

From-SVN: r76663

gcc/ChangeLog
gcc/config/h8300/h8300.c

index 2bdeffef1d24a5535a527af2a6d3ef8f1edf6083..483a47a01e6457dff4ad8438d7c93ecf0b17f20f 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-26  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/h8300/h8300.c (h8300_tiny_constant_address_p): Use a
+       switch statement instead of a chain of if statements.
+
 2004-01-26  Jeff Law  <law@redhat.com>
 
        * doc/contrib.texi: Minor cleanup for Paolo Carlini's entry.  Add
index 3c503a9393df176543dde2e388e135312afb3c46..97f7e9f0401f75c62899d412eea7351ca17b0984 100644 (file)
@@ -4434,21 +4434,24 @@ h8300_tiny_constant_address_p (rtx x)
 
   unsigned HOST_WIDE_INT addr;
 
-  /* We accept symbols declared with tiny_data.  */
-  if (GET_CODE (x) == SYMBOL_REF)
-    return (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_TINY_DATA) != 0;
+  switch (GET_CODE (x))
+    {
+    case SYMBOL_REF:
+      /* We accept symbols declared with tiny_data.  */
+      return (SYMBOL_REF_FLAGS (x) & SYMBOL_FLAG_TINY_DATA) != 0;
 
-  if (GET_CODE (x) != CONST_INT)
-    return 0;
+    case CONST_INT:
+      addr = INTVAL (x);
+      return (TARGET_NORMAL_MODE
+             || (TARGET_H8300H
+                 && (IN_RANGE (addr, h1, h2) || IN_RANGE (addr, h3, h4)))
+             || (TARGET_H8300S
+                 && (IN_RANGE (addr, s1, s2) || IN_RANGE (addr, s3, s4))));
 
-  addr = INTVAL (x);
+    default:
+      return 0;
+    }
 
-  return (0
-         || TARGET_NORMAL_MODE
-         || (TARGET_H8300H
-             && (IN_RANGE (addr, h1, h2) || IN_RANGE (addr, h3, h4)))
-         || (TARGET_H8300S
-             && (IN_RANGE (addr, s1, s2) || IN_RANGE (addr, s3, s4))));
 }
 
 int