aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-04-27 22:32:21 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2011-04-27 22:32:21 +0200
commitfa9f7c70400c3ca2172f95bb297b9eb62e437853 (patch)
tree3e3791e8fa72fcfe61caa5bbbb91944e02dc7af8 /gcc
parent1f428429c431c09ff92b91820d38072b6d42b895 (diff)
downloadgcc-fa9f7c70400c3ca2172f95bb297b9eb62e437853.zip
gcc-fa9f7c70400c3ca2172f95bb297b9eb62e437853.tar.gz
gcc-fa9f7c70400c3ca2172f95bb297b9eb62e437853.tar.bz2
re PR fortran/48788 (ICE: SIGSEGV in resolve_global_procedure (resolve.c:2190) on invalid (?) fortran code)
2011-04-27 Tobias Burnus <burnus@net-b.de> PR fortran/48788 * resolve.c (resolve_global_procedure): Error recovery - avoid segfault for (non)character-returning functions. 2011-04-27 Tobias Burnus <burnus@net-b.de> PR fortran/48788 * gfortran.dg/whole_file_34.f90: New. From-SVN: r173048
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/resolve.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/whole_file_34.f9012
4 files changed, 24 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 78d687d..46df318 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/48788
+ * resolve.c (resolve_global_procedure): Error recovery -
+ avoid segfault for (non)character-returning functions.
+
2011-04-26 Thomas Koenig <tkoenig@gcc.gnu.org>
* decl.c (gfc_match_end): Check that the block name starts
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index d7b95f5..144d308 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -2187,7 +2187,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
/* F2003, 12.3.1.1 (3c); F2008, 12.4.2.2 (3c) */
if (sym->ts.type == BT_CHARACTER && sym->attr.if_source != IFSRC_IFBODY
- && def_sym->ts.u.cl->length != NULL)
+ && def_sym->ts.type == BT_CHARACTER && def_sym->ts.u.cl->length != NULL)
{
gfc_charlen *cl = sym->ts.u.cl;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a99f1c4..d61af1b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/48788
+ * gfortran.dg/whole_file_34.f90: New.
+
2011-04-27 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-ssa/inline-9.c: New testcase.
diff --git a/gcc/testsuite/gfortran.dg/whole_file_34.f90 b/gcc/testsuite/gfortran.dg/whole_file_34.f90
new file mode 100644
index 0000000..9b421e0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/whole_file_34.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+!
+! PR fortran/48788
+!
+! Contributed by Zdenek Sojka
+!
+function foo ()
+end function foo
+ character(4), external :: foo ! { dg-error "Return type mismatch of function" }
+ character(4) :: x
+ x = foo ()
+END