From: FX Coudert <fxcoudert@gmail.com>
To: GNU Fortran <fortran@gcc.gnu.org>,
gcc-patches list <gcc-patches@gcc.gnu.org>
Subject: [gfortran,committed] Fix type mismatch from my previous NINT patch
Date: Tue, 14 Aug 2007 22:43:00 -0000 [thread overview]
Message-ID: <BC9DA6F8-E0B2-493A-9A2A-D51DE3D954DD@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 161 bytes --]
Attached patch fixes a type mismatch that was introduced by my recent
NINT patch. Committed after regtesting on x86_64-linux, with both -
m32 and -m64.
FX
[-- Attachment #2: foo.diff --]
[-- Type: application/octet-stream, Size: 1825 bytes --]
Index: ChangeLog
===================================================================
--- ChangeLog (revision 127493)
+++ ChangeLog (working copy)
@@ -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.
Index: trans-intrinsic.c
===================================================================
--- trans-intrinsic.c (revision 127493)
+++ trans-intrinsic.c (working copy)
@@ -314,10 +314,9 @@ build_fixbound_expr (stmtblock_t * pbloc
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));
}
reply other threads:[~2007-08-14 22:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BC9DA6F8-E0B2-493A-9A2A-D51DE3D954DD@gmail.com \
--to=fxcoudert@gmail.com \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).