aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2011-02-22 20:33:45 +0000
committerPaul Thomas <pault@gcc.gnu.org>2011-02-22 20:33:45 +0000
commit0b3b617eabcdf480d820bf5358f1f0dc629dbf74 (patch)
tree49ddaedb388488e0e8a9512185b898a6b96485c4 /gcc/fortran
parentca2409f9f23194cbb8b22c59796b48049975aae4 (diff)
downloadgcc-0b3b617eabcdf480d820bf5358f1f0dc629dbf74.zip
gcc-0b3b617eabcdf480d820bf5358f1f0dc629dbf74.tar.gz
gcc-0b3b617eabcdf480d820bf5358f1f0dc629dbf74.tar.bz2
re PR fortran/45743 (gfortran.dg/whole_file_3.f90 ICE: verify_stmts failed: invalid conversion in gimple call with -finline-small-functions)
2011-02-22 Paul Thomas <pault@gcc.gnu.org> PR fortran/45743 * trans-decl.c (gfc_get_extern_function_decl): Don't use the gsymbol backend_decl if the procedure has a formal argument that is a procedure. 2011-02-22 Paul Thomas <pault@gcc.gnu.org> PR fortran/45743 * gfortran.dg/whole_file_32.f90 : New test. From-SVN: r170414
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog7
-rw-r--r--gcc/fortran/trans-decl.c18
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index a19ba0b..159b1be 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,10 @@
+2011-02-22 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/45743
+ * trans-decl.c (gfc_get_extern_function_decl): Don't use the
+ gsymbol backend_decl if the procedure has a formal argument
+ that is a procedure.
+
2011-02-22 Tobias Burnus <burnus@net-b.de>
PR fortran/41359
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 616cca8..08207e0 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -1495,6 +1495,7 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
tree name;
tree mangled_name;
gfc_gsymbol *gsym;
+ bool proc_formal_arg;
if (sym->backend_decl)
return sym->backend_decl;
@@ -1511,10 +1512,27 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
return the backend_decl. */
gsym = gfc_find_gsymbol (gfc_gsym_root, sym->name);
+ /* Do not use procedures that have a procedure argument because this
+ can result in problems of multiple decls during inlining. */
+ proc_formal_arg = false;
+ if (gsym && gsym->ns && gsym->ns->proc_name)
+ {
+ gfc_formal_arglist *formal = gsym->ns->proc_name->formal;
+ for (; formal; formal = formal->next)
+ {
+ if (formal->sym && formal->sym->attr.flavor == FL_PROCEDURE)
+ {
+ proc_formal_arg = true;
+ break;
+ }
+ }
+ }
+
if (gfc_option.flag_whole_file
&& (!sym->attr.use_assoc || sym->attr.if_source != IFSRC_DECL)
&& !sym->backend_decl
&& gsym && gsym->ns
+ && !proc_formal_arg
&& ((gsym->type == GSYM_SUBROUTINE) || (gsym->type == GSYM_FUNCTION))
&& (gsym->ns->proc_name->backend_decl || !sym->attr.intrinsic))
{