aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2010-03-20 16:01:17 +0000
committerPaul Thomas <pault@gcc.gnu.org>2010-03-20 16:01:17 +0000
commitb8849663cfee62a5458940d18bfd0511f6377dc9 (patch)
tree36376a6bcc6f643c925edc656fda08666e1e6fa1 /gcc/fortran
parent21b04412b046c5819813c4b7d3853277385b93aa (diff)
downloadgcc-b8849663cfee62a5458940d18bfd0511f6377dc9.zip
gcc-b8849663cfee62a5458940d18bfd0511f6377dc9.tar.gz
gcc-b8849663cfee62a5458940d18bfd0511f6377dc9.tar.bz2
re PR fortran/43450 (-fwhole-file: ICE in gfc_create_module_variable, at fortran/trans-decl.c:3386)
2010-03-20 Paul Thomas <pault@gcc.gnu.org> PR fortran/43450 * trans-decl.c (gfc_create_module_variable): With -fwhole-file do not assert the context of derived types. 2010-03-20 Paul Thomas <pault@gcc.gnu.org> PR fortran/43450 * gfortran.dg/whole_file_15.f90 : New test. From-SVN: r157595
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-decl.c15
2 files changed, 16 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index d8a2d3e..03eb8fe 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-20 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/43450
+ * trans-decl.c (gfc_create_module_variable): With -fwhole-file
+ do not assert the context of derived types.
+
2010-03-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/43409
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 6f5f779..3dc070c 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -3382,11 +3382,16 @@ gfc_create_module_variable (gfc_symbol * sym)
{
decl = sym->backend_decl;
gcc_assert (sym->ns->proc_name->attr.flavor == FL_MODULE);
- gcc_assert (TYPE_CONTEXT (decl) == NULL_TREE
- || TYPE_CONTEXT (decl) == sym->ns->proc_name->backend_decl);
- gcc_assert (DECL_CONTEXT (TYPE_STUB_DECL (decl)) == NULL_TREE
- || DECL_CONTEXT (TYPE_STUB_DECL (decl))
- == sym->ns->proc_name->backend_decl);
+
+ /* -fwhole-file mixes up the contexts so these asserts are unnecessary. */
+ if (!(gfc_option.flag_whole_file && sym->attr.use_assoc))
+ {
+ gcc_assert (TYPE_CONTEXT (decl) == NULL_TREE
+ || TYPE_CONTEXT (decl) == sym->ns->proc_name->backend_decl);
+ gcc_assert (DECL_CONTEXT (TYPE_STUB_DECL (decl)) == NULL_TREE
+ || DECL_CONTEXT (TYPE_STUB_DECL (decl))
+ == sym->ns->proc_name->backend_decl);
+ }
TYPE_CONTEXT (decl) = sym->ns->proc_name->backend_decl;
DECL_CONTEXT (TYPE_STUB_DECL (decl)) = sym->ns->proc_name->backend_decl;
gfc_module_add_decl (cur_module, TYPE_STUB_DECL (decl));