This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[PATCH] Fix PR 32195 dllimport regression
- From: Danny Smith <dannysmith at clear dot net dot nz>
- To: GCC-patches <gcc-patches at gcc dot gnu dot org>
- Cc: François-Xavier Coudert <fxcoudert at gmail dot com>, GFORTRAN <fortran at gcc dot gnu dot org>
- Date: Sat, 28 Jul 2007 14:02:32 +1200
- Subject: [PATCH] Fix PR 32195 dllimport regression
Hello
The problem here is that dllimported symbols generated by the compiler
have NULL as a DECL_ASSEMBLER_NAME, so the comparision with the alias
decl_assembler_name_equal segfaults.
This regression is fallout Richard Henderson's rewrite of dllimport,
exposed here by the use of weakref in libgfortran
(As an aside why are you using a pthread_once weakref on mingw32?)
This fixes by giving the artifical dllimport decl an assembler name that
matches the identifier of the SYMBOL_REF.
:ADDPATCH i386:
2007-07-28 Danny Smith <dannysmith@users.sourcforge.net>
PR target/32915
* config/i386/i386.c (get_dllimport_decl):
SET_DECL_ASSEMBLER_NAME
of the generated dllimport decl.
Index: config/i386/i386.c
===================================================================
*** config/i386/i386.c (revision 126996)
--- config/i386/i386.c (working copy)
*************** get_dllimport_decl (tree decl)
*** 7611,7616 ****
--- 7604,7610 ----
set_mem_alias_set (rtl, ix86_GOT_alias_set ());
SET_DECL_RTL (to, rtl);
+ SET_DECL_ASSEMBLER_NAME (to, get_identifier (name));
return to;
}