aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-07-31 21:15:45 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-07-31 21:15:45 +0000
commit7d520b9b1220582ebd84badc309b6cbe0d074797 (patch)
treec46dcdbcb19ccc446fa5b560f601719b0d748673
parent14b1261a5b25da80aa1cbc2936397b472c7928d1 (diff)
downloadgcc-7d520b9b1220582ebd84badc309b6cbe0d074797.zip
gcc-7d520b9b1220582ebd84badc309b6cbe0d074797.tar.gz
gcc-7d520b9b1220582ebd84badc309b6cbe0d074797.tar.bz2
re PR fortran/32938 (ICE in emit_move_insn with -fdefault-integer-8)
PR fortran/32938 * trans-stmt.c (gfc_trans_return): Convert to correct type. * gfortran.dg/altreturn_6.f90: New test. From-SVN: r127106
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/trans-stmt.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/altreturn_6.f905
4 files changed, 17 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index ce3e62c..d7de098 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/32938
+ * trans-stmt.c (gfc_trans_return): Convert to correct type.
+
2007-07-31 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/32942
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 0ec1435..e731967 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -447,7 +447,8 @@ gfc_trans_return (gfc_code * code ATTRIBUTE_UNUSED)
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 ());
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4990638..1c05bf0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/32938
+ * gfortran.dg/altreturn_6.f90: New test.
+
2007-07-31 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/32942
diff --git a/gcc/testsuite/gfortran.dg/altreturn_6.f90 b/gcc/testsuite/gfortran.dg/altreturn_6.f90
new file mode 100644
index 0000000..61f5f60
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/altreturn_6.f90
@@ -0,0 +1,5 @@
+! PR 32938
+subroutine r (*)
+ integer(kind=8) :: i
+ return i
+end