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
This commit is contained in:
Francois-Xavier Coudert 2014-07-10 08:45:38 +00:00 committed by François-Xavier Coudert
parent 64d57736e1
commit 56710419ba
5 changed files with 20 additions and 25 deletions

View 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,

View 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. */
}
}

View 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. */
}
}

View 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. */
}
}

View 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;
}