This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
hash-table violation in gcc/fortran/trans-decl.c
- From: Martin Liška <mliska at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Nathan Sidwell <nathan at acm dot org>, Jason Merrill <jason at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>, Martin Jambor <mjambor at suse dot cz>, Trevor Saunders <tbsaunde at tbsaunde dot org>
- Date: Tue, 30 Oct 2018 11:07:16 +0100
- Subject: hash-table violation in gcc/fortran/trans-decl.c
- References: <23ffca95-6492-e609-aebb-bbdd83b5185d@suse.cz>
On 10/29/18 12:04 PM, Martin Liška wrote:
> 2) gfc_find_module
>
> $ ./xgcc -B. /home/marxin/Programming/gcc/gcc/testsuite/gfortran.dg/coarray/alloc_comp_2.f90 -fcoarray=single -fchecking=3
> hash table checking failed: equal operator returns true for a pair of values with a different hash valuef951: internal compiler error: in find_slot_with_hash, at hash-table.h:905
> 0x8e5e86 hash_table<module_hasher, xcallocator>::find_slot_with_hash(char const* const&, unsigned int, insert_option)
> /home/marxin/Programming/gcc/gcc/hash-table.h:905
> 0x8e2c2c gfc_find_module(char const*)
> /home/marxin/Programming/gcc/gcc/fortran/trans-decl.c:4865
> 0x8e4f42 gfc_generate_module_vars(gfc_namespace*)
> /home/marxin/Programming/gcc/gcc/fortran/trans-decl.c:5475
> 0x8b8d7e gfc_generate_module_code(gfc_namespace*)
> /home/marxin/Programming/gcc/gcc/fortran/trans.c:2190
> 0x868427 translate_all_program_units
> /home/marxin/Programming/gcc/gcc/fortran/parse.c:6112
> 0x868427 gfc_parse_file()
> /home/marxin/Programming/gcc/gcc/fortran/parse.c:6328
> 0x8b19cb gfc_be_parse_file
> /home/marxin/Programming/gcc/gcc/fortran/f95-lang.c:204
This one is real issue introduced in r216127, I'll post it to corresponding mailing list
after testing:
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 88f9f570725..e8da9e11d22 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -4825,7 +4825,7 @@ struct module_hasher : ggc_ptr_hash<module_htab_entry>
{
typedef const char *compare_type;
- static hashval_t hash (module_htab_entry *s) { return htab_hash_string (s); }
+ static hashval_t hash (module_htab_entry *s) { return htab_hash_string (s->name); }
static bool
equal (module_htab_entry *a, const char *b)
{
Martin