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]

Re: [patch i386 windows]: Fix PR/52790 also required for workig upcoming cygwin x64 target


On 2013-03-22 02:27, Kai Tietz wrote:
Hi,

this patch fixes PR/52790 and supports for x64 Windows targets the use
of large and medium code-model.
This feature is required for upcoming new cygwin x64 target, which
uses full 48-bit available address-space of x64 Windows.
The cygwin-target depends on pseudo-relocation-feature, which operates
on instruction relocations.  This can lead for x86_64 to issues, due
instructions are in general signed-32bit-pc-relative relocated.  So
distances can become too wide for pseudo-relocation.
Due for functions we generate anyway on pe-coff targets jump-stubs, we
just need to make sure that variables are accessed via
reference-pointer-variables.  So we add for them in medium model
.refptr-variables.
In large model we using for external (therefore possibly
pseudo-relocated) symbols also indirect-addressing via refptr-stubs.

To avoid same issues as we noticed on cygwin64, I want to change
code-model default to medium also for native-windows x64 target.

ChangeLog

2013-03-22  Kai Tietz  <ktietz@redhat.com>

	PR target/52790
	* config/i386/cygming.h (SUB_TARGET_RECORD_STUB): New sub-target macro.
	* config/i386/i386-protos.h (i386_pe_record_stub): Add new prototype.
	* config/i386/i386.c (legitimize_pe_coff_extern_decl): New static function.
	(legitimize_pe_coff_symbol): Likewise.
	(is_imported_p): New helper-function.
	(ix86_option_override_internal): Make MEDIUM_PIC the default code-model
	for Windows x64 targets.
	(ix86_expand_prologue): Optimize for pe-coff targets.
	(ix86_expand_split_stack_prologue): Adjust for pe-coff targets.
	(legitimate_pic_address_disp_p): Adjust for x64 pe-coff to support
	medium/large code-model.
	(legitimize_pic_address): Likewise.
	(legitimize_tls_address): Likewise.
	(ix86_expand_call): Likewise.
	(x86_output_mi_thunk): Likewise.
	(get_dllimport_decl): Add new beimport argument.
	(construct_plt_address): Don't assert for x64 pe-coff targets.
	* config/i386/i386.h (PIC_OFFSET_TABLE_REGNUM): Adjust for x64 pe-coff
	targets.
	(SYMBOL_FLAG_STUBVAR): New macro.
	(SYMBOL_REF_STUBVAR_P): Likewise.
	* config/i386/winnt.c (stub_list): New structure.
	(stub_head): New local variable.
	(i386_pe_record_stub): New function.
	(i386_pe_file_end): Emit refptr-stubs.

Ok.


r~


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