Commit a3d7ab92 by Kai Tietz Committed by Kai Tietz

re PR target/56975 (dllimport broken on i686-pc-cygwin)

2013-05-13  Kai Tietz  <ktietz@redhat.com>

	PR target/56975
	* config/i386/cygming.h (TARGET_PECOFF): Define as true.
	* config/i386/i386.h (TARGET_PECOFF): Define by default
	as false.
	(PIC_OFFSET_TABLE_REGNUM): Use TARGET_PECOFF.
	* config/i386/i386.c (ix86_option_override_internal):
	Likewise.
	(ix86_expand_prologue): Likewise.
	(ix86_expand_split_stack_prologue): Likewise.
	(legitimate_pic_address_disp_p): Likewise.
	(legitimize_pic_address): Likewise.
	(legitimize_tls_address): Likewise.
	(legitimize_pe_coff_symbol): Likewise.
	(output_pic_addr_const): Likewise.
	(construct_plt_address): Likewise.
	(ix86_expand_call): Likewise.
	(x86_output_mi_thunk): Likewise.
	(x86_function_profiler): Likewise.

From-SVN: r198852
parent 7c0b157d
2013-05-13 Kai Tietz <ktietz@redhat.com>
PR target/56975
* config/i386/cygming.h (TARGET_PECOFF): Define as true.
* config/i386/i386.h (TARGET_PECOFF): Define by default
as false.
(PIC_OFFSET_TABLE_REGNUM): Use TARGET_PECOFF.
* config/i386/i386.c (ix86_option_override_internal):
Likewise.
(ix86_expand_prologue): Likewise.
(ix86_expand_split_stack_prologue): Likewise.
(legitimate_pic_address_disp_p): Likewise.
(legitimize_pic_address): Likewise.
(legitimize_tls_address): Likewise.
(legitimize_pe_coff_symbol): Likewise.
(output_pic_addr_const): Likewise.
(construct_plt_address): Likewise.
(ix86_expand_call): Likewise.
(x86_output_mi_thunk): Likewise.
(x86_function_profiler): Likewise.
2013-05-13 Sofiane Naci <sofiane.naci@arm.com>
* config/aarch64/aarch64-simd.md (aarch64_simd_mov<mode>): Group
......
......@@ -55,6 +55,9 @@ along with GCC; see the file COPYING3. If not see
#undef DEFAULT_ABI
#define DEFAULT_ABI (TARGET_64BIT ? MS_ABI : SYSV_ABI)
#undef TARGET_PECOFF
#define TARGET_PECOFF 1
#if ! defined (USE_MINGW64_LEADING_UNDERSCORES)
#undef USER_LABEL_PREFIX
#define USER_LABEL_PREFIX (TARGET_64BIT ? "" : "_")
......
......@@ -3248,7 +3248,7 @@ ix86_option_override_internal (bool main_args_p)
use of rip-relative addressing. This eliminates fixups that
would otherwise be needed if this object is to be placed in a
DLL, and is essentially just as efficient as direct addressing. */
if (TARGET_64BIT && (TARGET_RDOS || DEFAULT_ABI == MS_ABI))
if (TARGET_64BIT && (TARGET_RDOS || TARGET_PECOFF))
ix86_cmodel = CM_MEDIUM_PIC, flag_pic = 1;
else if (TARGET_64BIT)
ix86_cmodel = flag_pic ? CM_SMALL_PIC : CM_SMALL;
......@@ -10594,7 +10594,7 @@ ix86_expand_prologue (void)
pic_reg_used = false;
/* We don't use pic-register for pe-coff target. */
if (pic_offset_table_rtx
&& DEFAULT_ABI != MS_ABI
&& !TARGET_PECOFF
&& (df_regs_ever_live_p (REAL_PIC_OFFSET_TABLE_REGNUM)
|| crtl->profile))
{
......@@ -11400,7 +11400,7 @@ ix86_expand_split_stack_prologue (void)
}
if ((ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC)
&& DEFAULT_ABI != MS_ABI)
&& !TARGET_PECOFF)
{
HOST_WIDE_INT argval;
......@@ -12125,7 +12125,7 @@ legitimate_pic_address_disp_p (rtx disp)
|| (TARGET_DLLIMPORT_DECL_ATTRIBUTES && SYMBOL_REF_DLLIMPORT_P (op0)))
return false;
if (DEFAULT_ABI == MS_ABI)
if (TARGET_PECOFF)
{
if (is_imported_p (op0))
return true;
......@@ -12212,7 +12212,7 @@ legitimate_pic_address_disp_p (rtx disp)
if ((GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF
|| GET_CODE (XVECEXP (disp, 0, 0)) == LABEL_REF)
&& !TARGET_64BIT)
return DEFAULT_ABI != MS_ABI && gotoff_operand (XVECEXP (disp, 0, 0), Pmode);
return !TARGET_PECOFF && gotoff_operand (XVECEXP (disp, 0, 0), Pmode);
return false;
case UNSPEC_GOTTPOFF:
case UNSPEC_GOTNTPOFF:
......@@ -12556,7 +12556,7 @@ legitimize_pic_address (rtx orig, rtx reg)
if (TARGET_64BIT && legitimate_pic_address_disp_p (addr))
new_rtx = addr;
else if (TARGET_64BIT && DEFAULT_ABI != MS_ABI
else if (TARGET_64BIT && !TARGET_PECOFF
&& ix86_cmodel != CM_SMALL_PIC && gotoff_operand (addr, Pmode))
{
rtx tmpreg;
......@@ -12591,7 +12591,7 @@ legitimize_pic_address (rtx orig, rtx reg)
else
new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, tmpreg);
}
else if (!TARGET_64BIT && DEFAULT_ABI != MS_ABI && gotoff_operand (addr, Pmode))
else if (!TARGET_64BIT && !TARGET_PECOFF && gotoff_operand (addr, Pmode))
{
/* This symbol may be referenced via a displacement from the PIC
base address (@GOTOFF). */
......@@ -12628,7 +12628,7 @@ legitimize_pic_address (rtx orig, rtx reg)
/* For x64 PE-COFF there is no GOT table. So we use address
directly. */
if (TARGET_64BIT && DEFAULT_ABI == MS_ABI)
if (TARGET_64BIT && TARGET_PECOFF)
{
new_rtx = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_PCREL);
new_rtx = gen_rtx_CONST (Pmode, new_rtx);
......@@ -12706,7 +12706,7 @@ legitimize_pic_address (rtx orig, rtx reg)
/* Check first to see if this is a constant offset from a @GOTOFF
symbol reference. */
if (DEFAULT_ABI != MS_ABI && gotoff_operand (op0, Pmode)
if (!TARGET_PECOFF && gotoff_operand (op0, Pmode)
&& CONST_INT_P (op1))
{
if (!TARGET_64BIT)
......@@ -12850,7 +12850,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
if (!TARGET_64BIT)
{
if (flag_pic && DEFAULT_ABI != MS_ABI)
if (flag_pic && !TARGET_PECOFF)
pic = pic_offset_table_rtx;
else
{
......@@ -13173,7 +13173,7 @@ legitimize_dllimport_symbol (rtx symbol, bool want_reg)
static rtx
legitimize_pe_coff_symbol (rtx addr, bool inreg)
{
if (DEFAULT_ABI != MS_ABI)
if (!TARGET_PECOFF)
return NULL_RTX;
if (TARGET_DLLIMPORT_DECL_ATTRIBUTES)
......@@ -13455,7 +13455,7 @@ output_pic_addr_const (FILE *file, rtx x, int code)
#endif
assemble_name (file, name);
}
if (!TARGET_MACHO && !(TARGET_64BIT && DEFAULT_ABI == MS_ABI)
if (!TARGET_MACHO && !(TARGET_64BIT && TARGET_PECOFF)
&& code == 'P' && ! SYMBOL_REF_LOCAL_P (x))
fputs ("@PLT", file);
break;
......@@ -23701,7 +23701,7 @@ construct_plt_address (rtx symbol)
rtx tmp, unspec;
gcc_assert (GET_CODE (symbol) == SYMBOL_REF);
gcc_assert (ix86_cmodel == CM_LARGE_PIC && DEFAULT_ABI != MS_ABI);
gcc_assert (ix86_cmodel == CM_LARGE_PIC && !TARGET_PECOFF);
gcc_assert (Pmode == DImode);
tmp = gen_reg_rtx (Pmode);
......@@ -23754,7 +23754,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
}
if (ix86_cmodel == CM_LARGE_PIC
&& DEFAULT_ABI != MS_ABI
&& !TARGET_PECOFF
&& MEM_P (fnaddr)
&& GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF
&& !local_symbolic_operand (XEXP (fnaddr, 0), VOIDmode))
......@@ -35102,7 +35102,7 @@ x86_output_mi_thunk (FILE *file,
if (TARGET_64BIT)
{
if (!flag_pic || targetm.binds_local_p (function)
|| DEFAULT_ABI == MS_ABI)
|| TARGET_PECOFF)
;
else
{
......@@ -35215,7 +35215,7 @@ x86_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED)
fprintf (file, "\tleaq\t%sP%d(%%rip),%%r11\n", LPREFIX, labelno);
#endif
if (DEFAULT_ABI == SYSV_ABI && flag_pic)
if (!TARGET_PECOFF && flag_pic)
fprintf (file, "\tcall\t*%s@GOTPCREL(%%rip)\n", mcount_name);
else
fprintf (file, "\tcall\t%s\n", mcount_name);
......@@ -537,6 +537,9 @@ extern tree x86_mfence;
/* This is re-defined by cygming.h. */
#define TARGET_SEH 0
/* This is re-defined by cygming.h. */
#define TARGET_PECOFF 0
/* The default abi used by target. */
#define DEFAULT_ABI SYSV_ABI
......@@ -1187,7 +1190,7 @@ enum target_cpu_default
#define PIC_OFFSET_TABLE_REGNUM \
((TARGET_64BIT && (ix86_cmodel == CM_SMALL_PIC \
|| DEFAULT_ABI == MS_ABI)) \
|| TARGET_PECOFF)) \
|| !flag_pic ? INVALID_REGNUM \
: reload_completed ? REGNO (pic_offset_table_rtx) \
: REAL_PIC_OFFSET_TABLE_REGNUM)
......
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