[PATCH] Fix PR 32195 dllimport regression

Danny Smith dannysmith@clear.net.nz
Sat Jul 28 02:02:00 GMT 2007


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;
  }



More information about the Fortran mailing list