Commit c833f6d2 by Francois-Xavier Coudert Committed by François-Xavier Coudert

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
parent fa3546f1
2007-08-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> 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 PR fortran/32594
* trans-expr.c (gfc_conv_substring_expr): Only call * trans-expr.c (gfc_conv_substring_expr): Only call
gfc_conv_substring if expr->ref is not NULL. gfc_conv_substring if expr->ref is not NULL.
......
...@@ -314,10 +314,9 @@ build_fixbound_expr (stmtblock_t * pblock, tree arg, tree type, int up) ...@@ -314,10 +314,9 @@ build_fixbound_expr (stmtblock_t * pblock, tree arg, tree type, int up)
static tree static tree
build_round_expr (tree arg, tree restype) build_round_expr (tree arg, tree restype)
{ {
tree tmp;
tree argtype; tree argtype;
tree fn; tree fn;
bool longlong, convert; bool longlong;
int argprec, resprec; int argprec, resprec;
argtype = TREE_TYPE (arg); argtype = TREE_TYPE (arg);
...@@ -328,21 +327,9 @@ build_round_expr (tree arg, tree restype) ...@@ -328,21 +327,9 @@ build_round_expr (tree arg, tree restype)
(lround family) or long long intrinsic (llround). We might also (lround family) or long long intrinsic (llround). We might also
need to convert the result afterwards. */ need to convert the result afterwards. */
if (resprec <= LONG_TYPE_SIZE) if (resprec <= LONG_TYPE_SIZE)
{
longlong = false; longlong = false;
if (resprec != LONG_TYPE_SIZE)
convert = true;
else
convert = false;
}
else if (resprec <= LONG_LONG_TYPE_SIZE) else if (resprec <= LONG_LONG_TYPE_SIZE)
{
longlong = true; longlong = true;
if (resprec != LONG_LONG_TYPE_SIZE)
convert = true;
else
convert = false;
}
else else
gcc_unreachable (); gcc_unreachable ();
...@@ -356,10 +343,7 @@ build_round_expr (tree arg, tree restype) ...@@ -356,10 +343,7 @@ build_round_expr (tree arg, tree restype)
else else
gcc_unreachable (); gcc_unreachable ();
tmp = build_call_expr (fn, 1, arg); return fold_convert (restype, build_call_expr (fn, 1, arg));
if (convert)
tmp = fold_convert (restype, tmp);
return tmp;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment