Commit 986ce92f by Kai Tietz Committed by Kai Tietz

re PR target/51900 (const variable initialization always zero)

	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.

From-SVN: r183450
parent 135b6fa4
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> 2012-01-23 Aldy Hernandez <aldyh@redhat.com>
* trans-mem.c (ipa_tm_create_version): Set externally_visible. * trans-mem.c (ipa_tm_create_version): Set externally_visible.
......
...@@ -13231,10 +13231,10 @@ ix86_delegitimize_address (rtx x) ...@@ -13231,10 +13231,10 @@ ix86_delegitimize_address (rtx x)
|| GET_CODE (XEXP (x, 0)) != UNSPEC || GET_CODE (XEXP (x, 0)) != UNSPEC
|| (XINT (XEXP (x, 0), 1) != UNSPEC_GOTPCREL || (XINT (XEXP (x, 0), 1) != UNSPEC_GOTPCREL
&& XINT (XEXP (x, 0), 1) != UNSPEC_PCREL) && 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); return ix86_delegitimize_tls_address (orig_x);
x = XVECEXP (XEXP (x, 0), 0, 0); 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, x = simplify_gen_subreg (GET_MODE (orig_x), x,
GET_MODE (x), 0); GET_MODE (x), 0);
...@@ -410,6 +410,7 @@ ...@@ -410,6 +410,7 @@
|| (GET_CODE (op) == UNSPEC || (GET_CODE (op) == UNSPEC
&& (XINT (op, 1) == UNSPEC_GOT && (XINT (op, 1) == UNSPEC_GOT
|| XINT (op, 1) == UNSPEC_GOTOFF || XINT (op, 1) == UNSPEC_GOTOFF
|| XINT (op, 1) == UNSPEC_PCREL
|| XINT (op, 1) == UNSPEC_GOTPCREL))) || XINT (op, 1) == UNSPEC_GOTPCREL)))
return true; return true;
if (GET_CODE (op) != PLUS if (GET_CODE (op) != PLUS
......
...@@ -350,21 +350,22 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first) ...@@ -350,21 +350,22 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first)
SYMBOL_REF_FLAGS (symbol) = flags; SYMBOL_REF_FLAGS (symbol) = flags;
} }
bool bool
i386_pe_binds_local_p (const_tree exp) 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) if ((TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == FUNCTION_DECL)
&& DECL_DLLIMPORT_P (exp)) && DECL_DLLIMPORT_P (exp))
return false; return false;
/* Or a weak one, now that they are supported. */ /* External public symbols, which aren't weakref-s,
if ((TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == FUNCTION_DECL) have local-binding for PE targets. */
&& DECL_WEAK (exp)) if (DECL_P (exp)
return false; && !lookup_attribute ("weakref", DECL_ATTRIBUTES (exp))
&& TREE_PUBLIC (exp)
return true; && DECL_EXTERNAL (exp))
return true;
return default_binds_local_p_1 (exp, 0);
} }
/* Also strip the fastcall prefix and stdcall suffix. */ /* Also strip the fastcall prefix and stdcall suffix. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment