]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
fpu-*.h (get_fpu_rounding_mode, [...]): Clean up, mark unreachable code as such.
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Thu, 10 Jul 2014 08:45:38 +0000 (08:45 +0000)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Thu, 10 Jul 2014 08:45:38 +0000 (08:45 +0000)
* config/fpu-*.h (get_fpu_rounding_mode, set_fpu_rounding_mode,
support_fpu_rounding_mode): Clean up, mark unreachable code as such.

From-SVN: r212423

libgfortran/ChangeLog
libgfortran/config/fpu-387.h
libgfortran/config/fpu-aix.h
libgfortran/config/fpu-glibc.h
libgfortran/config/fpu-sysv.h

index 245e6dbed5b9038217421f3a1f2d1a6469cef715..db9e42bd48a6bf14fb3bf7615560082053d913c4 100644 (file)
@@ -1,3 +1,8 @@
+2014-07-10  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       * config/fpu-*.h (get_fpu_rounding_mode, set_fpu_rounding_mode,
+       support_fpu_rounding_mode): Clean up, mark unreachable code as such.
+
 2014-07-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
        * libgfortran.h (support_fpu_underflow_control,
index 201173e581316bdfde2f55777a9733cc5f388552..0ccd8e602c44b53a27a458304c280cc9c01bf940 100644 (file)
@@ -421,7 +421,7 @@ get_fpu_rounding_mode (void)
     case _FPU_RC_ZERO:
       return GFC_FPE_TOWARDZERO;
     default:
-      return GFC_FPE_INVALID; /* Should be unreachable.  */
+      return 0; /* Should be unreachable.  */
     }
 }
 
index aec7756fda506a411dc4bf6ecf11c6b4871c5c9f..018b5ec45b52fa4b2df01a9982a1c2f47b1790fc 100644 (file)
@@ -291,8 +291,6 @@ support_fpu_flag (int flag)
 }
 
 
-
-
 int
 get_fpu_rounding_mode (void)
 {
@@ -321,8 +319,9 @@ get_fpu_rounding_mode (void)
       case FE_TOWARDZERO:
        return GFC_FPE_TOWARDZERO;
 #endif
+
       default:
-       return GFC_FPE_INVALID;
+       return 0; /* Should be unreachable.  */
     }
 }
 
@@ -357,8 +356,9 @@ set_fpu_rounding_mode (int mode)
        rnd_mode = FE_TOWARDZERO;
        break;
 #endif
+
       default:
-       return;
+       return; /* Should be unreachable.  */
     }
 
   fesetround (rnd_mode);
@@ -399,7 +399,7 @@ support_fpu_rounding_mode (int mode)
 #endif
 
       default:
-       return 0;
+       return 0; /* Should be unreachable.  */
     }
 }
 
index 149e8a3ac92681ea24116afadfef6b6dfdbbd2f2..d1d44c09cdbb83d0294f6fa5c2a29ea24f5896a5 100644 (file)
@@ -333,8 +333,9 @@ get_fpu_rounding_mode (void)
       case FE_TOWARDZERO:
        return GFC_FPE_TOWARDZERO;
 #endif
+
       default:
-       return GFC_FPE_INVALID;
+       return 0; /* Should be unreachable.  */
     }
 }
 
@@ -369,8 +370,9 @@ set_fpu_rounding_mode (int mode)
        rnd_mode = FE_TOWARDZERO;
        break;
 #endif
+
       default:
-       return;
+       return; /* Should be unreachable.  */
     }
 
   fesetround (rnd_mode);
@@ -411,7 +413,7 @@ support_fpu_rounding_mode (int mode)
 #endif
 
       default:
-       return 0;
+       return 0; /* Should be unreachable.  */
     }
 }
 
index 225f591af720ded7d56691fe750905d9fae7b8ef..b098d20d0299ffd653e959365a891caf97ab2ddb 100644 (file)
@@ -342,7 +342,7 @@ get_fpu_rounding_mode (void)
       case FP_RZ:
        return GFC_FPE_TOWARDZERO;
       default:
-       return GFC_FPE_INVALID;
+       return 0; /* Should be unreachable.  */
     }
 }
 
@@ -367,28 +367,16 @@ set_fpu_rounding_mode (int mode)
        rnd_mode = FP_RZ;
         break;
       default:
-       return;
+       return; /* Should be unreachable.  */
     }
   fpsetround (rnd_mode);
 }
 
 
 int
-support_fpu_rounding_mode (int mode)
+support_fpu_rounding_mode (int mode __attribute__((unused)))
 {
-  switch (mode)
-    {
-      case GFC_FPE_TONEAREST:
-       return 1;
-      case GFC_FPE_UPWARD:
-       return 1;
-      case GFC_FPE_DOWNWARD:
-       return 1;
-      case GFC_FPE_TOWARDZERO:
-       return 1;
-      default:
-       return 0;
-    }
+  return 1;
 }