diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2006-03-06 22:56:39 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2006-03-06 22:56:39 +0000 |
commit | 5f20c93a30af5976a0d096d7034fb43a0acebf06 (patch) | |
tree | ad8e6e07b196abe43de18b2f58d813f554c6e2ff /gcc/fortran/trans-openmp.c | |
parent | 9202989a98f7f0b7244cc4fe6efcb4e78833ad3d (diff) | |
download | gcc-5f20c93a30af5976a0d096d7034fb43a0acebf06.zip gcc-5f20c93a30af5976a0d096d7034fb43a0acebf06.tar.gz gcc-5f20c93a30af5976a0d096d7034fb43a0acebf06.tar.bz2 |
re PR fortran/26107 (ICE after error message on invalid code)
2006-03-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/26107
* resolve.c (resolve_function): Add name after test for pureness.
PR fortran/19546
* trans-expr.c (gfc_conv_variable): Detect reference to parent result,
store current_function_decl, replace with parent, whilst calls are
made to gfc_get_fake_result_decl, and restore afterwards. Signal this
to gfc_get_fake_result_decl with a new argument, parent_flag.
* trans-stmt.c (gfc_trans_return): gfc_get_fake_result_decl 2nd arg
is set to zero.
* trans.h: Add parent_flag to gfc_get_fake_result_decl prototype.
* trans-decl.c (gfc_get_fake_result_decl): On parent_flag, being set,
add decl to parent function. Replace refs to current_fake_result_decl
with refs to this_result_decl.
(gfc_generate_function_code): Null parent_fake_result_decl before the
translation of code for contained procedures. Set parent_flag to zero
in call to gfc_get_fake_result_decl.
* trans-intrinsic.c (gfc_conv_intrinsic_len): The same.
2006-03-06 Paul Thomas <pault@gcc.gnu.org>
PR fortran/26107
* pure_dummy_length_1.f90: New test.
PR fortran/19546
* gfortran.dg/parent_result_ref_1.f90: New test.
* gfortran.dg/parent_result_ref_2.f90: New test.
* gfortran.dg/parent_result_ref_3.f90: New test.
* gfortran.dg/parent_result_ref_4.f90: New test.
From-SVN: r111793
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r-- | gcc/fortran/trans-openmp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index 44be1b7..df8723b 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -182,6 +182,9 @@ gfc_trans_add_clause (tree node, tree tail) return node; } +/* TODO make references to parent function results, as done in + gfc_conv_variable. */ + static tree gfc_trans_omp_variable (gfc_symbol *sym) { @@ -191,7 +194,7 @@ gfc_trans_omp_variable (gfc_symbol *sym) Self recursive functions must have an explicit return value. */ if (t == current_function_decl && sym->attr.function && (sym->result == sym)) - t = gfc_get_fake_result_decl (sym); + t = gfc_get_fake_result_decl (sym, 0); /* Similarly for alternate entry points. */ else if (sym->attr.function && sym->attr.entry @@ -203,7 +206,7 @@ gfc_trans_omp_variable (gfc_symbol *sym) for (el = sym->ns->entries; el; el = el->next) if (sym == el->sym) { - t = gfc_get_fake_result_decl (sym); + t = gfc_get_fake_result_decl (sym, 0); break; } } @@ -212,7 +215,7 @@ gfc_trans_omp_variable (gfc_symbol *sym) && sym->ns->proc_name->backend_decl == current_function_decl && sym->ns->proc_name->attr.entry_master && !gfc_return_by_reference (sym->ns->proc_name)) - t = gfc_get_fake_result_decl (sym); + t = gfc_get_fake_result_decl (sym, 0); return t; } |