From 2bb02bf01ba23bbe2ee8d227a6033ce996638241 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tobias=20Schl=C3=BCter?=
 <tobias.schlueter@physik.uni-muenchen.de>
Date: Mon, 14 Mar 2005 20:55:02 +0100
Subject: [PATCH] re PR fortran/20467 (Bad fortran code causes ICE)

fortran/
PR fortran/20467
* symbol.c (check_conflict): A dummy argument can't be a statement
function.

testsuite/
PR fortran/20467
* gfortran.dg/stfunc_2.f90: New test.

From-SVN: r96443
---
 gcc/fortran/ChangeLog                  | 6 ++++++
 gcc/fortran/symbol.c                   | 1 +
 gcc/testsuite/ChangeLog                | 5 +++++
 gcc/testsuite/gfortran.dg/stfunc_2.f90 | 6 ++++++
 4 files changed, 18 insertions(+)
 create mode 100644 gcc/testsuite/gfortran.dg/stfunc_2.f90

diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 63172cb573b4..819442c593fa 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2005-03-14  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+	PR fortran/20467
+	* symbol.c (check_conflict): A dummy argument can't be a statement
+	function.
+
 2005-03-14  Zdenek Dvorak  <dvorakz@suse.cz>
 
 	* fortran/trans-intrinsic.c (gfc_conv_intrinsic_ishft): Convert
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 0b5e8e727a44..26e3f003442b 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -369,6 +369,7 @@ check_conflict (symbol_attribute * attr, const char * name, locus * where)
 	{
 	case PROC_ST_FUNCTION:
 	  conf2 (in_common);
+	  conf2 (dummy);
 	  break;
 
 	case PROC_MODULE:
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8ed2b48f3658..ef6463180c69 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-14  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+	PR fortran/20467
+	* gfortran.dg/stfunc_2.f90: New test.
+
 2005-03-14  Zdenek Dvorak  <dvorakz@suse.cz>
 
 	* gcc.dg/tree-ssa/phi-opt-5.c: New test.
diff --git a/gcc/testsuite/gfortran.dg/stfunc_2.f90 b/gcc/testsuite/gfortran.dg/stfunc_2.f90
new file mode 100644
index 000000000000..75ecb057b05f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/stfunc_2.f90
@@ -0,0 +1,6 @@
+! { dg-do compile }
+! PR 20467 : we didn't check if a statement function had the dummy attribute.
+SUBROUTINE a(b)
+        b(c) = 0  ! { dg-error "Unclassifiable statement" }
+END SUBROUTINE a
+
-- 
GitLab