* config/i386/predicates.md (symbolic_operand): Allow
UNSPEC_PCREL as PIC expression for lea.
* config/i386/winnt.c (i386_pe_binds_local_p): Reworked.
* config/i386/i386.c (ix86_delegitimize_address): Handle
UNSPEC_PCREL for none-MEM, too.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183450
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-01-23 Kai Tietz <ktietz@redhat.com>
+
+ PR target/51900
+ * config/i386/predicates.md (symbolic_operand): Allow
+ UNSPEC_PCREL as PIC expression for lea.
+ * config/i386/winnt.c (i386_pe_binds_local_p): Reworked.
+ * config/i386/i386.c (ix86_delegitimize_address): Handle
+ UNSPEC_PCREL for none-MEM, too.
+
2012-01-23 Aldy Hernandez <aldyh@redhat.com>
* trans-mem.c (ipa_tm_create_version): Set externally_visible.
|| GET_CODE (XEXP (x, 0)) != UNSPEC
|| (XINT (XEXP (x, 0), 1) != UNSPEC_GOTPCREL
&& XINT (XEXP (x, 0), 1) != UNSPEC_PCREL)
- || !MEM_P (orig_x))
+ || (!MEM_P (orig_x) && XINT (XEXP (x, 0), 1) != UNSPEC_PCREL))
return ix86_delegitimize_tls_address (orig_x);
x = XVECEXP (XEXP (x, 0), 0, 0);
- if (GET_MODE (orig_x) != GET_MODE (x))
+ if (GET_MODE (orig_x) != GET_MODE (x) && MEM_P (orig_x))
{
x = simplify_gen_subreg (GET_MODE (orig_x), x,
GET_MODE (x), 0);
|| (GET_CODE (op) == UNSPEC
&& (XINT (op, 1) == UNSPEC_GOT
|| XINT (op, 1) == UNSPEC_GOTOFF
+ || XINT (op, 1) == UNSPEC_PCREL
|| XINT (op, 1) == UNSPEC_GOTPCREL)))
return true;
if (GET_CODE (op) != PLUS
SYMBOL_REF_FLAGS (symbol) = flags;
}
+
bool
i386_pe_binds_local_p (const_tree exp)
{
- /* PE does not do dynamic binding. Indeed, the only kind of
- non-local reference comes from a dllimport'd symbol. */
if ((TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == FUNCTION_DECL)
&& DECL_DLLIMPORT_P (exp))
return false;
- /* Or a weak one, now that they are supported. */
- if ((TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == FUNCTION_DECL)
- && DECL_WEAK (exp))
- return false;
-
- return true;
+ /* External public symbols, which aren't weakref-s,
+ have local-binding for PE targets. */
+ if (DECL_P (exp)
+ && !lookup_attribute ("weakref", DECL_ATTRIBUTES (exp))
+ && TREE_PUBLIC (exp)
+ && DECL_EXTERNAL (exp))
+ return true;
+ return default_binds_local_p_1 (exp, 0);
}
/* Also strip the fastcall prefix and stdcall suffix. */