This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fortran Patches


Hi Janus,

could you also patches, which you commit as obvious to the mailing lists?

Regarding the last patch, the GNU style puts a line break after the ")" in:

+  if (!sym) return NULL;
+

Tobias
commit 12c8610481cc199a6019cd41d07dbdf8906032d0
Author: janus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Sep 15 17:48:27 2011 +0000

    2011-09-15  Janus Weil  <janus@gcc.gnu.org>
    
    	PR fortran/50401
    	* resolve.c (resolve_transfer): Check if component 'ref' is defined.
    
    	PR fortran/50403
    	* symbol.c (gfc_use_derived): Check if argument 'sym' is defined.
    
    
    2011-09-15  Janus Weil  <janus@gcc.gnu.org>
    
    	PR fortran/50401
    	PR fortran/50403
    	* gfortran.dg/function_types_3.f90: New.
    
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178889 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index eeb462f..a8e0273 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2011-09-15  Janus Weil  <janus@gcc.gnu.org>
+
+	PR fortran/50401
+	* resolve.c (resolve_transfer): Check if component 'ref' is defined.
+
+	PR fortran/50403
+	* symbol.c (gfc_use_derived): Check if argument 'sym' is defined.
+
 2011-09-14  Tobias Burnus  <burnus@net-b.de>
 
 	PR fortran/34547
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 9aab836..62750af 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -8222,7 +8222,7 @@ resolve_transfer (gfc_code *code)
 	}
     }
 
-  if (sym->as != NULL && sym->as->type == AS_ASSUMED_SIZE
+  if (sym->as != NULL && sym->as->type == AS_ASSUMED_SIZE && exp->ref
       && exp->ref->type == REF_ARRAY && exp->ref->u.ar.type == AR_FULL)
     {
       gfc_error ("Data transfer element at %L cannot be a full reference to "
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index b2f0f2b..e2f13b8 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -1945,6 +1945,8 @@ gfc_use_derived (gfc_symbol *sym)
   gfc_symtree *st;
   int i;
 
+  if (!sym) return NULL;
+
   if (sym->components != NULL || sym->attr.zero_comp)
     return sym;               /* Already defined.  */
 
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 86cdde0..0accd60 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-15  Janus Weil  <janus@gcc.gnu.org>
+
+	PR fortran/50401
+	PR fortran/50403
+	* gfortran.dg/function_types_3.f90: New.
+
 2011-09-15  Jason Merrill  <jason@redhat.com>
 
 	PR c++/50365
diff --git a/gcc/testsuite/gfortran.dg/function_types_3.f90 b/gcc/testsuite/gfortran.dg/function_types_3.f90
new file mode 100644
index 0000000..8d00f5f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/function_types_3.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+!
+! Contributed by Vittorio Zecca <zeccav@gmail.com>
+!
+! PR 50401: SIGSEGV in resolve_transfer
+
+  interface 
+    function f()      ! { dg-error "must be a dummy argument" }
+      dimension f(*)
+    end function
+  end interface
+  print *,f()
+end
+
+! PR 50403: SIGSEGV in gfc_use_derived
+
+type(f) function f()  ! { dg-error "conflicts with DERIVED attribute|is not accessible" }
+  f=110               ! { dg-error "Unclassifiable statement" }
+end
commit cde48a27b12d2c4d1a5aababb94f6695e9c00469
Author: janus <janus@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue Sep 13 18:37:33 2011 +0000

    2011-09-13  Janus Weil  <janus@gcc.gnu.org>
    
    	PR fortran/50379
    	* symbol.c (check_conflict): Check conflict between GENERIC and RESULT
    	attributes.
    
    
    2011-09-13  Janus Weil  <janus@gcc.gnu.org>
    
    	PR fortran/50379
    	* gfortran.dg/result_2.f90: New.
    
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178829 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 836967d..6e82538 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-13  Janus Weil  <janus@gcc.gnu.org>
+
+	PR fortran/50379
+	* symbol.c (check_conflict): Check conflict between GENERIC and RESULT
+	attributes.
+
 2011-09-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
 	PR fortran/50327
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index ce4ab3d..b2f0f2b 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -373,7 +373,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
     *volatile_ = "VOLATILE", *is_protected = "PROTECTED",
     *is_bind_c = "BIND(C)", *procedure = "PROCEDURE",
     *asynchronous = "ASYNCHRONOUS", *codimension = "CODIMENSION",
-    *contiguous = "CONTIGUOUS";
+    *contiguous = "CONTIGUOUS", *generic = "GENERIC";
   static const char *threadprivate = "THREADPRIVATE";
 
   const char *a1, *a2;
@@ -490,8 +490,6 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
   conf (in_common, codimension);
   conf (in_common, result);
 
-  conf (dummy, result);
-
   conf (in_equivalence, use_assoc);
   conf (in_equivalence, codimension);
   conf (in_equivalence, dummy);
@@ -503,7 +501,9 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
   conf (in_equivalence, allocatable);
   conf (in_equivalence, threadprivate);
 
+  conf (dummy, result);
   conf (entry, result);
+  conf (generic, result);
 
   conf (function, subroutine);
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]