aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-08-14 22:40:00 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-08-14 22:40:00 +0000
commitc833f6d2b4b3ca8e3bcd738c9dd0a8cb7e06b24c (patch)
tree36776424855ec9576ab6dab79336ed8fe3a1733e
parentfa3546f12eff8fd7db529ecc3c42666c8c8218cd (diff)
downloadgcc-c833f6d2b4b3ca8e3bcd738c9dd0a8cb7e06b24c.zip
gcc-c833f6d2b4b3ca8e3bcd738c9dd0a8cb7e06b24c.tar.gz
gcc-c833f6d2b4b3ca8e3bcd738c9dd0a8cb7e06b24c.tar.bz2
re PR fortran/33073 (Type mismatch in build_fixbound_expr())
PR fortran/33073 * trans-intrinsic.c (build_fixbound_expr): Convert to result type in all cases. From-SVN: r127494
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-intrinsic.c24
2 files changed, 10 insertions, 20 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 0801212..7eef7f9 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,5 +1,11 @@
2007-08-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+ PR fortran/33073
+ * trans-intrinsic.c (build_fixbound_expr): Convert to result type
+ in all cases.
+
+2007-08-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
PR fortran/32594
* trans-expr.c (gfc_conv_substring_expr): Only call
gfc_conv_substring if expr->ref is not NULL.
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index c8e1646..2e8b8a0 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -314,10 +314,9 @@ build_fixbound_expr (stmtblock_t * pblock, tree arg, tree type, int up)
static tree
build_round_expr (tree arg, tree restype)
{
- tree tmp;
tree argtype;
tree fn;
- bool longlong, convert;
+ bool longlong;
int argprec, resprec;
argtype = TREE_TYPE (arg);
@@ -328,21 +327,9 @@ build_round_expr (tree arg, tree restype)
(lround family) or long long intrinsic (llround). We might also
need to convert the result afterwards. */
if (resprec <= LONG_TYPE_SIZE)
- {
- longlong = false;
- if (resprec != LONG_TYPE_SIZE)
- convert = true;
- else
- convert = false;
- }
+ longlong = false;
else if (resprec <= LONG_LONG_TYPE_SIZE)
- {
- longlong = true;
- if (resprec != LONG_LONG_TYPE_SIZE)
- convert = true;
- else
- convert = false;
- }
+ longlong = true;
else
gcc_unreachable ();
@@ -356,10 +343,7 @@ build_round_expr (tree arg, tree restype)
else
gcc_unreachable ();
- tmp = build_call_expr (fn, 1, arg);
- if (convert)
- tmp = fold_convert (restype, tmp);
- return tmp;
+ return fold_convert (restype, build_call_expr (fn, 1, arg));
}