From bcb21886b9ea0c3836e401b75e0b8304b38aed2f Mon Sep 17 00:00:00 2001 From: Kirill Yukhin Date: Mon, 13 Oct 2014 17:26:49 +0000 Subject: re PR target/8340 (ICE on x86 inline asm w/ -fPIC) gcc/ PR target/8340 PR middle-end/47602 PR rtl-optimization/55458 * config/i386/i386.c (ix86_use_pseudo_pic_reg): New. (ix86_init_pic_reg): New. (ix86_select_alt_pic_regnum): Add check on pseudo register. (ix86_save_reg): Likewise. (ix86_expand_prologue): Remove PIC register initialization now performed in ix86_init_pic_reg. (ix86_output_function_epilogue): Add check on pseudo register. (set_pic_reg_ever_alive): New. (legitimize_pic_address): Replace df_set_regs_ever_live with new set_pic_reg_ever_alive. (legitimize_tls_address): Likewise. (ix86_pic_register_p): New check. (ix86_delegitimize_address): Add check on pseudo register. (ix86_expand_call): Insert move from pseudo PIC register to ABI defined REAL_PIC_OFFSET_TABLE_REGNUM. (TARGET_INIT_PIC_REG): New. (TARGET_USE_PSEUDO_PIC_REG): New. * config/i386/i386.h (PIC_OFFSET_TABLE_REGNUM): Return INVALID_REGNUM if pic_offset_table_rtx exists. * doc/tm.texi.in (TARGET_USE_PSEUDO_PIC_REG, TARGET_INIT_PIC_REG): Document. * doc/tm.texi: Regenerate. * function.c (assign_parms): Generate pseudo register for PIC. * init-regs.c (initialize_uninitialized_regs): Ignor pseudo PIC register. * ira-color.c (color_pass): Add check on pseudo register. * ira-emit.c (change_loop): Don't create copies for PIC pseudo register. * ira.c (split_live_ranges_for_shrink_wrap): Add check on pseudo register. (ira): Add target specific PIC register initialization. (do_reload): Keep PIC pseudo register. * lra-assigns.c (spill_for): Add checks on pseudo register. * lra-constraints.c (contains_symbol_ref_p): New. (lra_constraints): Enable lra risky transformations when PIC is pseudo register. * shrink-wrap.c (try_shrink_wrapping): Add check on pseudo register. * target.def (use_pseudo_pic_reg): New. (init_pic_reg): New. gcc/testsuite/ PR target/8340 PR middle-end/47602 PR rtl-optimization/55458 * gcc.target/i386/pic-1.c: Remove dg-error as test should pass now. * gcc.target/i386/pr55458.c: Likewise. * gcc.target/i386/pr47602.c: New. * gcc.target/i386/pr23098.c: Move to XFAIL. From-SVN: r216154 --- gcc/doc/tm.texi | 10 ++++++++++ gcc/doc/tm.texi.in | 4 ++++ 2 files changed, 14 insertions(+) (limited to 'gcc/doc') diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 10af50e..5036d4f 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -3902,6 +3902,16 @@ If @code{TARGET_FUNCTION_INCOMING_ARG} is not defined, @code{TARGET_FUNCTION_ARG} serves both purposes. @end deftypefn +@deftypefn {Target Hook} bool TARGET_USE_PSEUDO_PIC_REG (void) +This hook should return 1 in case pseudo register should be created +for pic_offset_table_rtx during function expand. +@end deftypefn + +@deftypefn {Target Hook} void TARGET_INIT_PIC_REG (void) +Perform a target dependent initialization of pic_offset_table_rtx. +This hook is called at the start of register allocation. +@end deftypefn + @deftypefn {Target Hook} int TARGET_ARG_PARTIAL_BYTES (cumulative_args_t @var{cum}, enum machine_mode @var{mode}, tree @var{type}, bool @var{named}) This target hook returns the number of bytes at the beginning of an argument that must be put in registers. The value must be zero for diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index f6f241b..5674e6c 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -3348,6 +3348,10 @@ the stack. @hook TARGET_FUNCTION_INCOMING_ARG +@hook TARGET_USE_PSEUDO_PIC_REG + +@hook TARGET_INIT_PIC_REG + @hook TARGET_ARG_PARTIAL_BYTES @hook TARGET_PASS_BY_REFERENCE -- cgit v1.1