summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-28 18:41:25 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2006-12-28 18:41:25 +0000
commit3ed99e5de728b21a09f911fa9a296d332c3aeed0 (patch)
treea28afc0cc08c6dc17b6c44c8ed834075cf7263b5 /gcc/fortran
parent2aea00a69f880bbd72f7f78f1ddcc5499a9f7147 (diff)
downloadgcc-3ed99e5de728b21a09f911fa9a296d332c3aeed0.tar.gz
2006-12-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30034 * resolve.c (resolve_formal_arglist): Exclude the test for pointers and procedures for subroutine arguments as well as functions. PR fortran/30237 * intrinsic.c (remove_nullargs): Do not pass up arguments with a label. If the actual has a label and the formal has a type then emit an error. 2006-12-28 Paul Thomas <pault@gcc.gnu.org> PR fortran/30034 * gfortran.dg/pure_formal_proc_1.f90: New test. PR fortran/30237 * gfortran.dg/intrinsic_actual_3.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120244 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog12
-rw-r--r--gcc/fortran/intrinsic.c8
-rw-r--r--gcc/fortran/resolve.c20
3 files changed, 26 insertions, 14 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8d9fd6e0ab8..f1042bcc8e9 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,15 @@
+2006-12-28 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/30034
+ * resolve.c (resolve_formal_arglist): Exclude the test for
+ pointers and procedures for subroutine arguments as well as
+ functions.
+
+ PR fortran/30237
+ * intrinsic.c (remove_nullargs): Do not pass up arguments with
+ a label. If the actual has a label and the formal has a type
+ then emit an error.
+
2006-12-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/30014
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index ea68d69e6c6..2ed42915b9d 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -2782,7 +2782,7 @@ remove_nullargs (gfc_actual_arglist ** ap)
{
next = head->next;
- if (head->expr == NULL)
+ if (head->expr == NULL && !head->label)
{
head->next = NULL;
gfc_free_actual_arglist (head);
@@ -2898,6 +2898,12 @@ do_sort:
for (f = formal; f; f = f->next)
{
+ if (f->actual && f->actual->label != NULL && f->ts.type)
+ {
+ gfc_error ("ALTERNATE RETURN not permitted at %L", where);
+ return FAILURE;
+ }
+
if (f->actual == NULL)
{
a = gfc_get_actual_arglist ();
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 9794446d169..2c71ae4c2d1 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -173,26 +173,20 @@ resolve_formal_arglist (gfc_symbol * proc)
if (sym->attr.flavor == FL_UNKNOWN)
gfc_add_flavor (&sym->attr, FL_VARIABLE, sym->name, &sym->declared_at);
- if (gfc_pure (proc))
+ if (gfc_pure (proc) && !sym->attr.pointer
+ && sym->attr.flavor != FL_PROCEDURE)
{
- if (proc->attr.function && !sym->attr.pointer
- && sym->attr.flavor != FL_PROCEDURE
- && sym->attr.intent != INTENT_IN)
-
+ if (proc->attr.function && sym->attr.intent != INTENT_IN)
gfc_error ("Argument '%s' of pure function '%s' at %L must be "
"INTENT(IN)", sym->name, proc->name,
&sym->declared_at);
- if (proc->attr.subroutine && !sym->attr.pointer
- && sym->attr.intent == INTENT_UNKNOWN)
-
- gfc_error
- ("Argument '%s' of pure subroutine '%s' at %L must have "
- "its INTENT specified", sym->name, proc->name,
- &sym->declared_at);
+ if (proc->attr.subroutine && sym->attr.intent == INTENT_UNKNOWN)
+ gfc_error ("Argument '%s' of pure subroutine '%s' at %L must "
+ "have its INTENT specified", sym->name, proc->name,
+ &sym->declared_at);
}
-
if (gfc_elemental (proc))
{
if (sym->as != NULL)