+2012-07-10 Uros Bizjak <ubizjak@gmail.com>
+
+ Backport from mainline
+ 2012-07-03 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/53811
+ * config/i386/i386.c (x86_output_mi_thunk): Check if fnaddr satisfies
+ sibcall_insn_operand. Move it to a temporary register if not.
+
+ 2012-07-06 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/53853
+ * config/i386/i386.c (x86_output_mi_thunk): For CM_LARGE_PIC model,
+ emit PIC sequence for fnaddr symbol reference in advance.
+
2012-07-09 Jason Merrill <jason@redhat.com>
PR c++/53882
2012-03-30 Richard Guenther <rguenther@suse.de>
PR middle-end/52786
- * double-int.c (rshift_double): Remove not needed
- cast.
+ * double-int.c (rshift_double): Remove not needed cast.
2012-03-28 Richard Guenther <rguenther@suse.de>
{
rtx this_param = x86_this_parameter (function);
rtx this_reg, tmp, fnaddr;
+ unsigned int tmp_regno;
+
+ if (TARGET_64BIT)
+ tmp_regno = R10_REG;
+ else
+ {
+ unsigned int ccvt = ix86_get_callcvt (TREE_TYPE (function));
+ if ((ccvt & (IX86_CALLCVT_FASTCALL | IX86_CALLCVT_THISCALL)) != 0)
+ tmp_regno = AX_REG;
+ else
+ tmp_regno = CX_REG;
+ }
emit_note (NOTE_INSN_PROLOGUE_END);
{
if (!x86_64_general_operand (delta_rtx, Pmode))
{
- tmp = gen_rtx_REG (Pmode, R10_REG);
+ tmp = gen_rtx_REG (Pmode, tmp_regno);
emit_move_insn (tmp, delta_rtx);
delta_rtx = tmp;
}
if (vcall_offset)
{
rtx vcall_addr, vcall_mem, this_mem;
- unsigned int tmp_regno;
- if (TARGET_64BIT)
- tmp_regno = R10_REG;
- else
- {
- unsigned int ccvt = ix86_get_callcvt (TREE_TYPE (function));
- if ((ccvt & (IX86_CALLCVT_FASTCALL | IX86_CALLCVT_THISCALL)) != 0)
- tmp_regno = AX_REG;
- else
- tmp_regno = CX_REG;
- }
tmp = gen_rtx_REG (Pmode, tmp_regno);
this_mem = gen_rtx_MEM (ptr_mode, this_reg);
emit_jump_insn (gen_indirect_jump (fnaddr));
else
{
+ if (ix86_cmodel == CM_LARGE_PIC && SYMBOLIC_CONST (fnaddr))
+ fnaddr = legitimize_pic_address (fnaddr,
+ gen_rtx_REG (Pmode, tmp_regno));
+
+ if (!sibcall_insn_operand (fnaddr, Pmode))
+ {
+ tmp = gen_rtx_REG (Pmode, tmp_regno);
+ if (GET_MODE (fnaddr) != Pmode)
+ fnaddr = gen_rtx_ZERO_EXTEND (Pmode, fnaddr);
+ emit_move_insn (tmp, fnaddr);
+ fnaddr = tmp;
+ }
+
tmp = gen_rtx_MEM (QImode, fnaddr);
tmp = gen_rtx_CALL (VOIDmode, tmp, const0_rtx);
tmp = emit_call_insn (tmp);
--- /dev/null
+// { dg-do compile }
+// { dg-options "-mcmodel=large" { target { { i?86-*-* x86_64-*-* } && lp64 } } }
+
+struct ICCStringClass
+{
+ virtual void *
+ CreateString (const char *fromText) = 0;
+};
+
+struct AGSCCDynamicObject
+{
+ virtual void
+ Unserialize (int index, const char *serializedData, int dataSize) = 0;
+};
+
+
+struct ScriptString:AGSCCDynamicObject, ICCStringClass
+{
+ virtual void *CreateString (const char *fromText);
+};
+
+const char *
+CreateNewScriptString (const char *fromText, bool reAllocate = true);
+
+void *
+ScriptString::CreateString (const char *fromText)
+{
+ return (void *) CreateNewScriptString (fromText);
+}