This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44945] [4.6 Regression] Wrong decl for module vars / FAIL: gfortran.dg/char_array_structure_constructor.f90
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 19 Feb 2011 13:08:34 +0000
- Subject: [Bug fortran/44945] [4.6 Regression] Wrong decl for module vars / FAIL: gfortran.dg/char_array_structure_constructor.f90
- Auto-submitted: auto-generated
- References: <bug-44945-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44945
--- Comment #31 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-19 13:08:26 UTC ---
(In reply to comment #29)
> A candidate fix for the PR
Aha, you have taken the simple route of modifying trans-decl.c and not the
whole module reading apparatus :-)
I think the patch is OK, though I would do some reordering, e.g. "sym->module"
is not needed as the whole block is enclosed in such a check.
I also would move the block down into
if (gsym && gsym->ns && gsym->type == GSYM_MODULE)
which could be changed into
if (!gsym || (gsym && gsym->ns && gsym->type == GSYM_MODULE))
And
- gfc_find_symbol (sym->name, gsym->ns, 0, &s);
+ if (gsym)
+ gfc_find_symbol (sym->name, gsym->ns, 0, &s);
And then placing the "if (gsym == NULL)" in the
+ else if (s == NULL)
block.
(In reply to comment #30)
> The bus error reported in comment #21 has disappeared from my scope between
> revisions 167584 and 167726;-(
Ditto here, but looking at the dump, I see that the underlying issue is still
present - and it is fixed by the patch.
* * *
I will do some more tests.
Related to those whole-file DECL issues: I wonder why there are still
differences between -flto and -fno-lto on Polyhedron (result is correct but
runtimes are different) and for Jack (-O3 miscompilation of xplor-nih's slink.f
and tenso.f, unless -fno-whole-file is used; -fno-inline-functions does not
help).