This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Fix up Cygwin/Mingwin regressions


My patch for PR 7910 exchanged one bit of brokenness in winnt.c for
another.  The key point is that the input RTL for something which is
marked "dllimport" can be in one of two forms, and the output RTL must
have the same form.

Tested with a cross compiler from i686-pc-linux-gnu, applied on the
mainline and on the branch.

--
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery dot com

2003-04-21  Mark Mitchell  <mark at codesourcery dot com>

	* config/i386/winnt.c (i386_pe_mark_dllimport): Make the new RTL
	have the same form as the old RTL.

Index: config/i386/winnt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/winnt.c,v
retrieving revision 1.43
diff -c -5 -p -r1.43 winnt.c
*** config/i386/winnt.c	12 Apr 2003 20:01:28 -0000	1.43
--- config/i386/winnt.c	21 Apr 2003 15:18:36 -0000
*************** i386_pe_mark_dllimport (decl)
*** 272,281 ****
--- 272,282 ----
  {
    const char *oldname;
    char  *newname;
    tree idp;
    rtx rtlname;
+   rtx new_symbol;
  
    rtlname = XEXP (DECL_RTL (decl), 0);
    if (GET_CODE (rtlname) == SYMBOL_REF)
      oldname = XSTR (rtlname, 0);
    else if (GET_CODE (rtlname) == MEM
*************** i386_pe_mark_dllimport (decl)
*** 333,344 ****
       address.  RTL processing can sometimes peek inside the symbol ref
       and compare the string's addresses to see if two symbols are
       identical.  */
    idp = get_identifier (newname);
  
!   XEXP (DECL_RTL (decl), 0) 
!     = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
  
    /* Can't treat a pointer to this as a constant address */
    DECL_NON_ADDR_CONST_P (decl) = 1;
  }
  
--- 334,348 ----
       address.  RTL processing can sometimes peek inside the symbol ref
       and compare the string's addresses to see if two symbols are
       identical.  */
    idp = get_identifier (newname);
  
!   new_symbol = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp));
!   XEXP (DECL_RTL (decl), 0)
!     = ((GET_CODE (XEXP (DECL_RTL (decl), 0)) == MEM)
!        ? gen_rtx (MEM, Pmode, new_symbol)
!        : new_symbol);
  
    /* Can't treat a pointer to this as a constant address */
    DECL_NON_ADDR_CONST_P (decl) = 1;
  }
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]