summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog27
-rw-r--r--gcc/fortran/interface.c17
-rw-r--r--gcc/fortran/module.c14
-rw-r--r--gcc/fortran/trans-array.c15
4 files changed, 65 insertions, 8 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 57ad11b3214..6502f1a0802 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,4 +1,29 @@
-2008-02-21 Thomas Koenig <tkoenig@gcc.gnu.org>
+2009-02-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/39309
+ * module.c (read_md5_from_module_file): Add missing quote.
+
+2009-02-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/39309
+ * module.c (read_md5_from_module_file): Include mod version
+ in had-changed test.
+
+2009-02-26 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/39295
+ * interface.c (compare_type_rank_if): Return 1 if the symbols
+ are the same and deal with external procedures where one is
+ identified to be a function or subroutine by usage but the
+ other is not.
+
+2009-02-26 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/39292
+ * trans-array.c (gfc_conv_array_initializer): Convert all
+ expressions rather than ICEing.
+
+2009-02-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/38914
* array.c (ref_dimen_size): Rename to gfc_ref_dimen_size,
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 5b2bdd10665..88638070d3c 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -491,17 +491,26 @@ compare_type_rank_if (gfc_symbol *s1, gfc_symbol *s2)
if (s1 == NULL || s2 == NULL)
return s1 == s2 ? 1 : 0;
+ if (s1 == s2)
+ return 1;
+
if (s1->attr.flavor != FL_PROCEDURE && s2->attr.flavor != FL_PROCEDURE)
return compare_type_rank (s1, s2);
if (s1->attr.flavor != FL_PROCEDURE || s2->attr.flavor != FL_PROCEDURE)
return 0;
- /* At this point, both symbols are procedures. */
- if ((s1->attr.function == 0 && s1->attr.subroutine == 0)
- || (s2->attr.function == 0 && s2->attr.subroutine == 0))
- return 0;
+ /* At this point, both symbols are procedures. It can happen that
+ external procedures are compared, where one is identified by usage
+ to be a function or subroutine but the other is not. Check TKR
+ nonetheless for these cases. */
+ if (s1->attr.function == 0 && s1->attr.subroutine == 0)
+ return s1->attr.external == 1 ? compare_type_rank (s1, s2) : 0;
+
+ if (s2->attr.function == 0 && s2->attr.subroutine == 0)
+ return s2->attr.external == 1 ? compare_type_rank (s1, s2) : 0;
+ /* Now the type of procedure has been identified. */
if (s1->attr.function != s2->attr.function
|| s1->attr.subroutine != s2->attr.subroutine)
return 0;
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index bfc4ef9f0d2..d5a9f54a76a 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -4739,8 +4739,18 @@ read_md5_from_module_file (const char * filename, unsigned char md5[16])
return -1;
/* Read two lines. */
- if (fgets (buf, sizeof (buf) - 1, file) == NULL
- || fgets (buf, sizeof (buf) - 1, file) == NULL)
+ if (fgets (buf, sizeof (buf) - 1, file) == NULL)
+ {
+ fclose (file);
+ return -1;
+ }
+
+ /* The file also needs to be overwritten if the version number changed. */
+ n = strlen ("GFORTRAN module version '" MOD_VERSION "' created");
+ if (strncmp (buf, "GFORTRAN module version '" MOD_VERSION "' created", n) != 0)
+ return -1;
+
+ if (fgets (buf, sizeof (buf) - 1, file) == NULL)
{
fclose (file);
return -1;
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 2b23f15cba4..6c623504af8 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -4005,8 +4005,21 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr)
CONSTRUCTOR_APPEND_ELT (v, index, se.expr);
break;
+
default:
- gcc_unreachable ();
+ /* Catch those occasional beasts that do not simplify
+ for one reason or another, assuming that if they are
+ standard defying the frontend will catch them. */
+ gfc_conv_expr (&se, c->expr);
+ if (range == NULL_TREE)
+ CONSTRUCTOR_APPEND_ELT (v, index, se.expr);
+ else
+ {
+ if (index != NULL_TREE)
+ CONSTRUCTOR_APPEND_ELT (v, index, se.expr);
+ CONSTRUCTOR_APPEND_ELT (v, range, se.expr);
+ }
+ break;
}
}
break;