diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2007-01-14 14:43:08 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2007-01-14 14:43:08 +0000 |
commit | c89686a895de9490e7be5c47865cb5cd3fc0401e (patch) | |
tree | a4e352dd03599277713f5a6c685f160069c96b6c /gcc | |
parent | acdc40dfd2305e16f92e15273dad1cc6d8bee32c (diff) | |
download | gcc-c89686a895de9490e7be5c47865cb5cd3fc0401e.zip gcc-c89686a895de9490e7be5c47865cb5cd3fc0401e.tar.gz gcc-c89686a895de9490e7be5c47865cb5cd3fc0401e.tar.bz2 |
re PR fortran/30410 (Host association bug w/ EXTERNAL)
2007-01-14 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30410
* trans-decl.c (gfc_sym_mangled_function_id): Module, external
symbols must not have the module name prepended.
2007-01-14 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30410
* gfortran.dg/external_procedures_2.f90: New test.
From-SVN: r120771
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 27 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/external_procedures_2.f90 | 41 |
4 files changed, 55 insertions, 22 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 367e170..5c8567b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-01-14 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/30410 + * trans-decl.c (gfc_sym_mangled_function_id): Module, external + symbols must not have the module name prepended. + 2007-01-11 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/30415 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 2a03416..44ccbcc 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -315,7 +315,8 @@ gfc_sym_mangled_function_id (gfc_symbol * sym) char name[GFC_MAX_MANGLED_SYMBOL_LEN + 1]; if (sym->module == NULL || sym->attr.proc == PROC_EXTERNAL - || (sym->module != NULL && sym->attr.if_source == IFSRC_IFBODY)) + || (sym->module != NULL && (sym->attr.external + || sym->attr.if_source == IFSRC_IFBODY))) { if (strcmp (sym->name, "MAIN__") == 0 || sym->attr.proc == PROC_INTRINSIC) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e6fa28d..c9a79b1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,25 +1,6 @@ -2007-01-14 Uros Bizjak <ubizjak@gmail.com> - - PR target/30413 - * gcc.target/i386/pr30413.c: New test. - -2007-01-14 Thomas Koenig <Thomas.Koenig@online.de> - - PR fortran/30452 - * gfortran.dg/string_0xfe_0xff_1.f90: New test. - -2007-01-13 Zdenek Dvorak <dvorakz@suse.cz> - - * gcc.dg/20070112-1.c: New test. - -2007-01-12 Jerry DeLisle <jvdelisle@gcc.gnu.org> - - PR libgfortran/30435 - * gfortran.dg/list_read_6.f90: New test. - 2007-01-12 Olga Golovanevsky <olga@il.ibm.com> - * gcc.dg/torture/pr24750-1.c: Add prototype of free. + * gcc.dg/torture/pr24750-1.c: Add prototype of free. 2007-01-12 Tom Tromey <tromey@redhat.com> @@ -69,7 +50,6 @@ * gcc.dg/fold-compare-2.c: New test case for fold_comparison. ->>>>>>> .r120737 2007-01-09 Brooks Moses <brooks.moses@codesourcery.com> * gfortran.dg/chkbits.f90: Added IBCLR tests; test calls @@ -171,6 +151,11 @@ * g++.dg/template/duplicate1.C: New test * g++.dg/template/memfriend6.C: Adjust error markers. +2007-01-14 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/30410 + * gfortran.dg/external_procedures_2.f90: New test. + 2007-01-05 Andrew Pinski <Andrew_Pinski@playstation.sony.com> PR tree-opt/30385 diff --git a/gcc/testsuite/gfortran.dg/external_procedures_2.f90 b/gcc/testsuite/gfortran.dg/external_procedures_2.f90 new file mode 100644 index 0000000..3f13dac --- /dev/null +++ b/gcc/testsuite/gfortran.dg/external_procedures_2.f90 @@ -0,0 +1,41 @@ +! { dg-do compile } +! Tests the for PR30410, in which the reference to extfunc would +! be incorrectly made to the module namespace. +! +! Contributed by Harald Anlauf <anlauf@gmx.de> +! +module mod1 +contains + function eval (func, x1) + real :: eval, func, x1 + external :: func + eval = func (x1) + end function eval +end module mod1 +!------------------------------- +module mod2 + use mod1, only : eval + real, external :: extfunc ! This was referenced as __mod2__extfunc__ +contains + + subroutine foo (x0) + real :: x0, x1 + x1 = 42 + x0 = eval (extfunc, x1) + end subroutine foo + +end module mod2 +!------------------------------- +function extfunc (x) + real, intent(in) :: x + real :: extfunc + extfunc = x +end function extfunc +!------------------------------- +program gfcbug53 + use mod2, only : foo + real :: x0 = 0 + call foo (x0) + print *, x0 +end program gfcbug53 +! { dg-final { cleanup-modules "mod1 mod2" } } |