aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2011-04-01 19:31:23 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2011-04-01 19:31:23 +0000
commit6e98bce41ede3e64ea559278e6a6f386cb45b141 (patch)
tree5cf51b524d4b8edb5c160642c2006d7948483fa3 /gcc/fortran
parentb318fb4bbc8d6cd14f8171ceaeb7326a1750e57b (diff)
downloadgcc-6e98bce41ede3e64ea559278e6a6f386cb45b141.zip
gcc-6e98bce41ede3e64ea559278e6a6f386cb45b141.tar.gz
gcc-6e98bce41ede3e64ea559278e6a6f386cb45b141.tar.bz2
re PR fortran/48352 (segfault in fortran/frontend-passes.c)
2011-04-01 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/48352 * frontend-passes (cfe_register_funcs): Don't register functions if they appear as iterators in DO loops. 2011-04-01 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/48352 * gfortran.dg/function_optimize_3.f90: New test. From-SVN: r171849
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/frontend-passes.c7
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index b651ae2..c2e1fa0 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,4 +1,10 @@
-2011-03-30 Michael Matz matz@suse.de>
+2011-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/48352
+ * frontend-passes (cfe_register_funcs): Don't
+ register functions if they appear as iterators in DO loops.
+
+2011-03-30 Michael Matz <matz@suse.de>
PR fortran/47516
* trans-expr.c (realloc_lhs_loop_for_fcn_call): Take loop as parameter,
diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c
index 6e59c37..755bae0 100644
--- a/gcc/fortran/frontend-passes.c
+++ b/gcc/fortran/frontend-passes.c
@@ -137,6 +137,13 @@ static int
cfe_register_funcs (gfc_expr **e, int *walk_subtrees ATTRIBUTE_UNUSED,
void *data ATTRIBUTE_UNUSED)
{
+
+ /* FIXME - there is a bug in the insertion code for DO loops. Bail
+ out here. */
+
+ if ((*current_code)->op == EXEC_DO)
+ return 0;
+
if ((*e)->expr_type != EXPR_FUNCTION)
return 0;