summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-25 16:21:42 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-25 16:21:42 +0000
commita93489b1fade2879369bfda69f05f3501a2eaaf6 (patch)
tree58acf096a7038e31494474c4bcfe8d3e8a06e679 /gcc
parent4eca871eeec7abdc36d98e1d13934092f798c1d6 (diff)
downloadgcc-a93489b1fade2879369bfda69f05f3501a2eaaf6.tar.gz
2010-01-25 Tobias Burnus <burnus@net-b.de>
PR fortran/42858 * array.c (gfc_array_dimen_size): Fix intrinsic procedure check. 2010-01-25 Tobias Burnus <burnus@net-b.de> PR fortran/42858 * gfortran.dg/generic_21.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156214 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/array.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/generic_21.f9033
4 files changed, 46 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 760fc24f451..a72bc3ea4fd 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-25 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/42858
+ * array.c (gfc_array_dimen_size): Fix intrinsic procedure
+ check.
+
2010-01-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/41044
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index 139609cca4b..094026f0bcc 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -1,5 +1,5 @@
/* Array things
- Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008
+ Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Andy Vaught
@@ -2054,7 +2054,7 @@ gfc_array_dimen_size (gfc_expr *array, int dimen, mpz_t *result)
}
if (array->symtree->n.sym->attr.generic
- && !array->symtree->n.sym->attr.intrinsic)
+ && array->value.function.esym != NULL)
{
if (spec_dimen_size (array->value.function.esym->as, dimen, result)
== FAILURE)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0719703700d..46b1eb071f7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-25 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/42858
+ * gfortran.dg/generic_21.f90: New test.
+
2010-01-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR testsuite/41522
diff --git a/gcc/testsuite/gfortran.dg/generic_21.f90 b/gcc/testsuite/gfortran.dg/generic_21.f90
new file mode 100644
index 00000000000..c651e639427
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/generic_21.f90
@@ -0,0 +1,33 @@
+! { dg-do compile }
+!
+! PR fortran/42858
+!
+! Contributed by Harald Anlauf
+!
+module gfcbug102
+ implicit none
+ type t_vector_segm
+ real ,pointer :: x(:) => NULL()
+ end type t_vector_segm
+
+ type t_vector
+ integer :: n_s = 0
+ type (t_vector_segm) ,pointer :: s (:) => NULL()
+ end type t_vector
+
+ interface sqrt
+ module procedure sqrt_vector
+ end interface sqrt
+
+contains
+ function sqrt_vector (x) result (y)
+ type (t_vector) :: y
+ type (t_vector) ,intent(in) :: x
+ integer :: i
+ do i = 1, y% n_s
+ y% s(i)% x = sqrt (x% s(i)% x)
+ end do
+ end function sqrt_vector
+end module gfcbug102
+
+! { dg-final { cleanup-modules "gfcbug102" } }