diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2014-07-10 08:45:38 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2014-07-10 08:45:38 +0000 |
commit | 56710419ba3361dca740bfa1dc29be0d959246de (patch) | |
tree | 335d5fbe0653c2504cdc444571192116b9208f1f /libgfortran | |
parent | 64d57736e1a48e31107587f06c411f93a500cc8d (diff) | |
download | gcc-56710419ba3361dca740bfa1dc29be0d959246de.zip gcc-56710419ba3361dca740bfa1dc29be0d959246de.tar.gz gcc-56710419ba3361dca740bfa1dc29be0d959246de.tar.bz2 |
fpu-*.h (get_fpu_rounding_mode, [...]): Clean up, mark unreachable code as such.
* 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
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 5 | ||||
-rw-r--r-- | libgfortran/config/fpu-387.h | 2 | ||||
-rw-r--r-- | libgfortran/config/fpu-aix.h | 10 | ||||
-rw-r--r-- | libgfortran/config/fpu-glibc.h | 8 | ||||
-rw-r--r-- | libgfortran/config/fpu-sysv.h | 20 |
5 files changed, 20 insertions, 25 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 245e6db..db9e42b 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -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, diff --git a/libgfortran/config/fpu-387.h b/libgfortran/config/fpu-387.h index 201173e..0ccd8e6 100644 --- a/libgfortran/config/fpu-387.h +++ b/libgfortran/config/fpu-387.h @@ -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. */ } } diff --git a/libgfortran/config/fpu-aix.h b/libgfortran/config/fpu-aix.h index aec7756..018b5ec 100644 --- a/libgfortran/config/fpu-aix.h +++ b/libgfortran/config/fpu-aix.h @@ -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. */ } } diff --git a/libgfortran/config/fpu-glibc.h b/libgfortran/config/fpu-glibc.h index 149e8a3..d1d44c0 100644 --- a/libgfortran/config/fpu-glibc.h +++ b/libgfortran/config/fpu-glibc.h @@ -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. */ } } diff --git a/libgfortran/config/fpu-sysv.h b/libgfortran/config/fpu-sysv.h index 225f591..b098d20 100644 --- a/libgfortran/config/fpu-sysv.h +++ b/libgfortran/config/fpu-sysv.h @@ -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; } |