aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-intrinsic.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2005-05-18 15:57:48 +0200
committerTobias Schlüter <tobi@gcc.gnu.org>2005-05-18 15:57:48 +0200
commite743d142aebcc694e105de1dcc588ee3e2a003f6 (patch)
tree346316216ddb9ff4964b58b06b2000f123fcbedd /gcc/fortran/trans-intrinsic.c
parent33af9c08e1e52c20df5c2b7488628c037d03918a (diff)
downloadgcc-e743d142aebcc694e105de1dcc588ee3e2a003f6.zip
gcc-e743d142aebcc694e105de1dcc588ee3e2a003f6.tar.gz
gcc-e743d142aebcc694e105de1dcc588ee3e2a003f6.tar.bz2
f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_TRUNC and BUILT_IN_TRUNCF instead of BUILT_IN_FLOOR and...
* f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_TRUNC and BUILT_IN_TRUNCF instead of BUILT_IN_FLOOR and BUILT_IN_FLOORF. * trans-intrinsic.c (build_fix_expr): Change 'op' argument to correct enum type. (gfc_conv_intrinsic_aint): Likewise. Clarify comment in front of function. Add default case to switch, deal with FIX_TRUNC_EXPR instead of FIX_FLOOR_EXPR. From-SVN: r99900
Diffstat (limited to 'gcc/fortran/trans-intrinsic.c')
-rw-r--r--gcc/fortran/trans-intrinsic.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 4558174..97f00dc 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -277,7 +277,8 @@ build_round_expr (stmtblock_t * pblock, tree arg, tree type)
however the RTL expander only actually supports FIX_TRUNC_EXPR. */
static tree
-build_fix_expr (stmtblock_t * pblock, tree arg, tree type, int op)
+build_fix_expr (stmtblock_t * pblock, tree arg, tree type,
+ enum tree_code op)
{
switch (op)
{
@@ -300,14 +301,15 @@ build_fix_expr (stmtblock_t * pblock, tree arg, tree type, int op)
/* Round a real value using the specified rounding mode.
We use a temporary integer of that same kind size as the result.
- Values larger than can be represented by this kind are unchanged, as
- will not be accurate enough to represent the rounding.
+ Values larger than those that can be represented by this kind are
+ unchanged, as thay will not be accurate enough to represent the
+ rounding.
huge = HUGE (KIND (a))
aint (a) = ((a > huge) || (a < -huge)) ? a : (real)(int)a
*/
static void
-gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, int op)
+gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, enum tree_code op)
{
tree type;
tree itype;
@@ -337,17 +339,21 @@ gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, int op)
}
break;
- case FIX_FLOOR_EXPR:
+ case FIX_TRUNC_EXPR:
switch (kind)
{
case 4:
- n = BUILT_IN_FLOORF;
+ n = BUILT_IN_TRUNCF;
break;
case 8:
- n = BUILT_IN_FLOOR;
+ n = BUILT_IN_TRUNC;
break;
}
+ break;
+
+ default:
+ gcc_unreachable ();
}
/* Evaluate the argument. */