This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH,fortran/32942] Give EXPONENT the correct return type
- From: FX Coudert <fxcoudert at gmail dot com>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 31 Jul 2007 21:44:10 +0100
- Subject: Re: [PATCH,fortran/32942] Give EXPONENT the correct return type
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=bNkppc69nBrfpKJmPuvjI3F6aonSER6fXgD93sRix8RDVXxbHT2BWdqMLTG//aifvx/0ynp8M5bXRghKCjxE3E3774A2bUhr8Bszqjr7faz/bgCFHYWdO9ViNQVwwlX2WtSiWMP6ATMsrEDkYa/RvwIq7JM5mjywv5hWKn7fokQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=NM9mIsbReigJpTYpwWb1elw6OKJzBCRLH8HNQzF1f6iGJHQm1bR7TEoNqOATNwLvSWWWfuC6adU48qII1/fXBKTpaXsGHVavF5BLXfLPy4I07kHCu8pi3U7vFQuo8md1jSMHcyG6M/egzz+WwhvWD34F3w6Z1Fha4InkTQLFMy0=
- References: <20070731203157.GA30019@troutmask.apl.washington.edu>
2007-07-31 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/32942
*trans-intrinsic.c (gfc_conv_intrinsic_exponent): Convert to correct
type.
OK to commit.
It looks like many of the -fdefault-integer-8 bugs will allow us to
catch occurences of these problems. I'm currently regtesting the
following fix for PR 32938, which I'll commit as obvious as soon as
regtest is finished (along with ChangeLog entry and testcase, of
course).
Index: trans-stmt.c
===================================================================
--- trans-stmt.c (revision 127059)
+++ trans-stmt.c (working copy)
@@ -447,7 +447,8 @@ gfc_trans_return (gfc_code * code ATTRIB
gfc_conv_expr (&se, code->expr);
- tmp = build2 (MODIFY_EXPR, TREE_TYPE (result), result, se.expr);
+ tmp = build2 (MODIFY_EXPR, TREE_TYPE (result), result,
+ fold_convert (TREE_TYPE (result), se.expr));
gfc_add_expr_to_block (&se.pre, tmp);
tmp = build1_v (GOTO_EXPR, gfc_get_return_label ());