remove PIC (non-working and disabled)

This commit is contained in:
YamaArashi
2016-02-14 19:26:29 -08:00
parent abcd805cb7
commit 62f1c8373a
24 changed files with 12 additions and 163 deletions

View File

@@ -1495,12 +1495,6 @@ thumb_override_options()
else
warning("Structure size boundary can only be set to 8 or 32");
}
if (flag_pic)
{
warning("Position independent code not supported. Ignored");
flag_pic = 0;
}
}
/* Return nonzero if ATTR is a valid attribute for DECL.

View File

@@ -2398,10 +2398,6 @@ set_nonvarying_address_components (addr, size, pbase, pstart, pend)
start = 0;
end = 0;
if (flag_pic && GET_CODE (base) == PLUS
&& XEXP (base, 0) == pic_offset_table_rtx)
base = XEXP (base, 1);
/* Registers with nonvarying addresses usually have constant equivalents;
but the frame pointer register is also possible. */
if (GET_CODE (base) == REG
@@ -8633,9 +8629,6 @@ cse_main (f, nregs, after_loop, file)
#endif
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (i == ARG_POINTER_REGNUM && fixed_regs[i])
#endif
#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
&& ! (i == PIC_OFFSET_TABLE_REGNUM && flag_pic)
#endif
)
|| global_regs[i])

View File

@@ -2699,10 +2699,7 @@ restart:
switch (GET_CODE (x))
{
case PC:
if (flag_pic)
dyn_string_append (str, ",");
else
abort ();
abort ();
break;
case SYMBOL_REF:

View File

@@ -149,7 +149,6 @@ rtx struct_value_rtx; /* (REG:Pmode STRUCT_VALUE_REGNUM) */
rtx struct_value_incoming_rtx; /* (REG:Pmode STRUCT_VALUE_INCOMING_REGNUM) */
rtx static_chain_rtx; /* (REG:Pmode STATIC_CHAIN_REGNUM) */
rtx static_chain_incoming_rtx; /* (REG:Pmode STATIC_CHAIN_INCOMING_REGNUM) */
rtx pic_offset_table_rtx; /* (REG:Pmode PIC_OFFSET_TABLE_REGNUM) */
/* This is used to implement __builtin_return_address for some machines.
See for instance the MIPS port. */
@@ -3630,9 +3629,6 @@ init_emit_once (line_numbers)
#endif
#endif
#ifdef PIC_OFFSET_TABLE_REGNUM
pic_offset_table_rtx = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
#endif
#ifdef INIT_EXPANDERS
/* This is to initialize save_machine_status and restore_machine_status before

View File

@@ -4953,20 +4953,6 @@ force_operand (value, target)
/* Use subtarget as the target for operand 0 of a binary operation. */
register rtx subtarget = (target != 0 && GET_CODE (target) == REG ? target : 0);
/* Check for a PIC address load. */
if (flag_pic
&& (GET_CODE (value) == PLUS || GET_CODE (value) == MINUS)
&& XEXP (value, 0) == pic_offset_table_rtx
&& (GET_CODE (XEXP (value, 1)) == SYMBOL_REF
|| GET_CODE (XEXP (value, 1)) == LABEL_REF
|| GET_CODE (XEXP (value, 1)) == CONST))
{
if (!subtarget)
subtarget = gen_reg_rtx (GET_MODE (value));
emit_move_insn (subtarget, value);
return subtarget;
}
if (GET_CODE (value) == PLUS)
binoptab = add_optab;
else if (GET_CODE (value) == MINUS)
@@ -11605,14 +11591,6 @@ do_tablejump (index, mode, range, table_label, default_label)
if (mode != Pmode)
index = convert_to_mode (Pmode, index, 1);
/* Don't let a MEM slip thru, because then INDEX that comes
out of PIC_CASE_VECTOR_ADDRESS won't be a valid address,
and break_out_memory_refs will go to work on it and mess it up. */
#ifdef PIC_CASE_VECTOR_ADDRESS
if (flag_pic && GET_CODE (index) != REG)
index = copy_to_mode_reg (Pmode, index);
#endif
/* If flag_force_addr were to affect this address
it could interfere with the tricky assumptions made
about addresses that contain label-refs,
@@ -11625,12 +11603,8 @@ do_tablejump (index, mode, range, table_label, default_label)
gen_rtx_MULT (Pmode, index,
GEN_INT (GET_MODE_SIZE (CASE_VECTOR_MODE))),
gen_rtx_LABEL_REF (Pmode, table_label));
#ifdef PIC_CASE_VECTOR_ADDRESS
if (flag_pic)
index = PIC_CASE_VECTOR_ADDRESS (index);
else
#endif
index = memory_address_noforce (CASE_VECTOR_MODE, index);
index = memory_address_noforce (CASE_VECTOR_MODE, index);
temp = gen_reg_rtx (CASE_VECTOR_MODE);
vector = gen_rtx_MEM (CASE_VECTOR_MODE, index);
RTX_UNCHANGING_P (vector) = 1;
@@ -11638,9 +11612,9 @@ do_tablejump (index, mode, range, table_label, default_label)
emit_jump_insn (gen_tablejump (temp, table_label));
/* If we are generating PIC code or if the table is PC-relative, the
/* If the table is PC-relative, the
table and JUMP_INSN must be adjacent, so don't output a BARRIER. */
if (! CASE_VECTOR_PC_RELATIVE && ! flag_pic)
if (! CASE_VECTOR_PC_RELATIVE)
emit_barrier ();
}

View File

@@ -94,9 +94,6 @@ extern rtx current_function_arg_offset_rtx;
/* This is nonzero if the current function uses the constant pool. */
extern int current_function_uses_const_pool;
/* This is nonzero if the current function uses pic_offset_table_rtx. */
extern int current_function_uses_pic_offset_table;
/* The arg pointer hard register, or the pseudo into which it was copied. */
extern rtx current_function_internal_arg_pointer;

View File

@@ -2627,10 +2627,7 @@ output_addr_const (file, x)
switch (GET_CODE (x))
{
case PC:
if (flag_pic)
putc ('.', file);
else
abort ();
abort ();
break;
case SYMBOL_REF:

View File

@@ -356,11 +356,6 @@ extern int flag_pretend_float;
extern int flag_pedantic_errors;
/* Nonzero means generate position-independent code.
This is not fully implemented yet. */
extern int flag_pic;
/* Nonzero means generate extra code for exception handling and enable
exception handling. */

View File

@@ -213,9 +213,6 @@ rtx current_function_return_rtx;
int current_function_uses_const_pool;
/* Nonzero if the current function uses pic_offset_table_rtx. */
int current_function_uses_pic_offset_table;
/* The arg pointer hard register, or the pseudo into which it was copied. */
rtx current_function_internal_arg_pointer;
@@ -531,7 +528,6 @@ push_function_context_to (context)
p->varargs = current_function_varargs;
p->stdarg = current_function_stdarg;
p->uses_const_pool = current_function_uses_const_pool;
p->uses_pic_offset_table = current_function_uses_pic_offset_table;
p->internal_arg_pointer = current_function_internal_arg_pointer;
p->cannot_inline = current_function_cannot_inline;
p->max_parm_reg = max_parm_reg;
@@ -617,7 +613,6 @@ pop_function_context_from (context)
current_function_varargs = p->varargs;
current_function_stdarg = p->stdarg;
current_function_uses_const_pool = p->uses_const_pool;
current_function_uses_pic_offset_table = p->uses_pic_offset_table;
current_function_internal_arg_pointer = p->internal_arg_pointer;
current_function_cannot_inline = p->cannot_inline;
max_parm_reg = p->max_parm_reg;
@@ -5621,7 +5616,6 @@ init_function_start (subr, filename, line)
current_function_returns_pcc_struct = 0;
current_function_returns_struct = 0;
current_function_uses_const_pool = 0;
current_function_uses_pic_offset_table = 0;
current_function_cannot_inline = 0;
/* CYGNUS LOCAL -- Branch Prediction */
current_function_uses_expect = 0;

View File

@@ -195,14 +195,9 @@ struct function
/* For integrate.c. */
int uses_const_pool;
/* For md files. */
int uses_pic_offset_table;
/* tm.h can use this to store whatever it likes. */
struct machine_function *machine;
/* For reorg. */
rtx epilogue_delay_list;
/* For varasm. */
struct constant_descriptor **const_rtx_hash_table;
struct pool_sym **const_rtx_sym_hash_table;

View File

@@ -2230,9 +2230,6 @@ compute_hash_table (set_p)
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (regno == ARG_POINTER_REGNUM && fixed_regs[regno])
#endif
#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
&& ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic)
#endif
&& regno != FRAME_POINTER_REGNUM)
|| global_regs[regno])
@@ -2687,9 +2684,6 @@ compute_kill_rd ()
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (regno == ARG_POINTER_REGNUM
&& fixed_regs[regno])
#endif
#if defined (PIC_OFFSET_TABLE_REGNUM) && !defined (PIC_OFFSET_TABLE_REG_CALL_CLOBBERED)
&& ! (regno == PIC_OFFSET_TABLE_REGNUM && flag_pic)
#endif
&& regno != FRAME_POINTER_REGNUM)
|| global_regs[regno])

View File

@@ -360,7 +360,6 @@ int optimize = 0;
They won't actually be used. */
struct _global_rtl global_rtl;
rtx pic_offset_table_rtx;
static void attr_hash_add_rtx PROTO((int, rtx));
static void attr_hash_add_string PROTO((int, char *));

View File

@@ -296,8 +296,7 @@ initialize_for_inline (fndecl, min_labelno, max_labelno, max_reg, copy)
+ current_function_needs_context * FUNCTION_FLAGS_NEEDS_CONTEXT
+ current_function_has_nonlocal_label * FUNCTION_FLAGS_HAS_NONLOCAL_LABEL
+ current_function_returns_pointer * FUNCTION_FLAGS_RETURNS_POINTER
+ current_function_uses_const_pool * FUNCTION_FLAGS_USES_CONST_POOL
+ current_function_uses_pic_offset_table * FUNCTION_FLAGS_USES_PIC_OFFSET_TABLE);
+ current_function_uses_const_pool * FUNCTION_FLAGS_USES_CONST_POOL);
/* Clear out PARMDECL_MAP. It was allocated in the caller's frame. */
zero_memory ((char *) parmdecl_map, max_parm_reg * sizeof (tree));
@@ -1589,11 +1588,6 @@ expand_inline_function (fndecl, parms, target, ignore, type,
if (OUTGOING_ARGS_SIZE (header) > current_function_outgoing_args_size)
current_function_outgoing_args_size = OUTGOING_ARGS_SIZE (header);
/* If the inline function needs to make PIC references, that means
that this function's PIC offset table must be used. */
if (FUNCTION_FLAGS (header) & FUNCTION_FLAGS_USES_PIC_OFFSET_TABLE)
current_function_uses_pic_offset_table = 1;
/* If this function needs a context, set it up. */
if (FUNCTION_FLAGS (header) & FUNCTION_FLAGS_NEEDS_CONTEXT)
static_chain_value = lookup_static_chain (fndecl);
@@ -3406,9 +3400,6 @@ output_inline_function (fndecl)
if (FUNCTION_FLAGS (head) & FUNCTION_FLAGS_USES_CONST_POOL)
current_function_uses_const_pool = 1;
if (FUNCTION_FLAGS (head) & FUNCTION_FLAGS_USES_PIC_OFFSET_TABLE)
current_function_uses_pic_offset_table = 1;
current_function_outgoing_args_size = OUTGOING_ARGS_SIZE (head);
current_function_pops_args = POPS_ARGS (head);

View File

@@ -446,14 +446,6 @@ extern char *current_function_name;
extern rtx current_function_return_rtx;
#endif
/* Nonzero means generate position-independent code.
This is not fully implemented yet. */
extern int flag_pic;
/* This is nonzero if the current function uses pic_offset_table_rtx. */
extern int current_function_uses_pic_offset_table;
/* This is nonzero if the current function uses the constant pool. */
extern int current_function_uses_const_pool;
@@ -481,7 +473,7 @@ extern FILE *rtl_dump_file;
&& DECL_INITIAL (DECL) \
&& (DECL_INITIAL (DECL) == error_mark_node \
|| TREE_CONSTANT (DECL_INITIAL (DECL))) \
&& ! (RELOC && (flag_pic || DECL_ONE_ONLY (DECL))))
&& ! (RELOC && (DECL_ONE_ONLY (DECL))))
/* User label prefix in effect for this compilation. */
extern char *user_label_prefix;

View File

@@ -910,9 +910,6 @@ general_operand (op, mode)
if (CONSTANT_P (op))
return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode)
#ifdef LEGITIMATE_PIC_OPERAND_P
&& (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
#endif
&& LEGITIMATE_CONSTANT_P (op));
/* Except for certain constants with VOIDmode, already checked for,
@@ -1073,9 +1070,6 @@ immediate_operand (op, mode)
return (CONSTANT_P (op)
&& (GET_MODE (op) == mode || mode == VOIDmode
|| GET_MODE (op) == VOIDmode)
#ifdef LEGITIMATE_PIC_OPERAND_P
&& (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
#endif
&& LEGITIMATE_CONSTANT_P (op));
}
@@ -1136,9 +1130,6 @@ nonmemory_operand (op, mode)
return 0;
return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode)
#ifdef LEGITIMATE_PIC_OPERAND_P
&& (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
#endif
&& LEGITIMATE_CONSTANT_P (op));
}

View File

@@ -1341,9 +1341,6 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn)
break;
case 'i':
if (CONSTANT_P (op)
#ifdef LEGITIMATE_PIC_OPERAND_P
&& (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
#endif
)
win = 1;
break;
@@ -1386,9 +1383,6 @@ record_reg_classes (n_alts, n_ops, ops, modes, constraints, insn)
case 'g':
if (GET_CODE (op) == MEM
|| (CONSTANT_P (op)
#ifdef LEGITIMATE_PIC_OPERAND_P
&& (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
#endif
))
win = 1;
allows_mem = 1;

View File

@@ -3101,9 +3101,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
break;
case 'i':
if (CONSTANT_P (operand)
#ifdef LEGITIMATE_PIC_OPERAND_P
&& (! flag_pic || LEGITIMATE_PIC_OPERAND_P (operand))
#endif
)
win = 1;
break;
@@ -3139,11 +3136,6 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
&& GET_CODE (operand) != PLUS
/* A SCRATCH is not a valid operand. */
&& GET_CODE (operand) != SCRATCH
#ifdef LEGITIMATE_PIC_OPERAND_P
&& (! CONSTANT_P (operand)
|| ! flag_pic
|| LEGITIMATE_PIC_OPERAND_P (operand))
#endif
&& (GENERAL_REGS == ALL_REGS
|| GET_CODE (operand) != REG
|| (REGNO (operand) >= FIRST_PSEUDO_REGISTER

View File

@@ -693,11 +693,6 @@ reload (first, global, dumpfile)
{
rtx note = find_reg_note (insn, REG_EQUIV, NULL_RTX);
if (note
#ifdef LEGITIMATE_PIC_OPERAND_P
&& (! function_invariant_p (XEXP (note, 0))
|| ! flag_pic
|| LEGITIMATE_PIC_OPERAND_P (XEXP (note, 0)))
#endif
)
{
rtx x = XEXP (note, 0);

View File

@@ -942,9 +942,6 @@ mark_target_live_regs (insns, target, res)
#endif
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& ! (i == ARG_POINTER_REGNUM && fixed_regs[i])
#endif
#ifdef PIC_OFFSET_TABLE_REGNUM
&& ! (i == PIC_OFFSET_TABLE_REGNUM && flag_pic)
#endif
)
CLEAR_HARD_REG_BIT (current_live_regs, i);

View File

@@ -713,7 +713,6 @@ extern char *note_insn_name[];
#define FUNCTION_FLAGS_RETURNS_POINTER 0100
#define FUNCTION_FLAGS_USES_CONST_POOL 0200
#define FUNCTION_FLAGS_CALLS_LONGJMP 0400
#define FUNCTION_FLAGS_USES_PIC_OFFSET_TABLE 01000
/* Define a macro to look for REG_INC notes,
but save time on machines where they never exist. */
@@ -1108,7 +1107,6 @@ extern struct _global_rtl
#define stack_pointer_rtx (&global_rtl.stack_pointer_val)
#define frame_pointer_rtx (&global_rtl.frame_pointer_val)
extern rtx pic_offset_table_rtx;
extern rtx struct_value_rtx;
extern rtx struct_value_incoming_rtx;
extern rtx static_chain_rtx;

View File

@@ -105,7 +105,7 @@ rtx_varies_p (x)
eliminated the frame and/or arg pointer and are using it
for pseudos. */
return ! (x == frame_pointer_rtx || x == hard_frame_pointer_rtx
|| x == arg_pointer_rtx || x == pic_offset_table_rtx);
|| x == arg_pointer_rtx);
case LO_SUM:
/* The operand 0 of a LO_SUM is considered constant

View File

@@ -4944,9 +4944,6 @@ expand_end_case (orig_index)
|| count < (unsigned int) CASE_VALUES_THRESHOLD
|| ((unsigned HOST_WIDE_INT) (TREE_INT_CST_LOW (range))
> 10 * count)
#ifndef ASM_OUTPUT_ADDR_DIFF_ELT
|| flag_pic
#endif
|| TREE_CODE (index_expr) == INTEGER_CST
/* These will reduce to a constant. */
|| (TREE_CODE (index_expr) == CALL_EXPR
@@ -5156,7 +5153,7 @@ expand_end_case (orig_index)
/* Output the table */
emit_label (table_label);
if (CASE_VECTOR_PC_RELATIVE || flag_pic)
if (CASE_VECTOR_PC_RELATIVE)
emit_jump_insn (gen_rtx_ADDR_DIFF_VEC (CASE_VECTOR_MODE,
gen_rtx_LABEL_REF (Pmode, table_label),
gen_rtvec_v (ncases, labelvec),

View File

@@ -516,13 +516,6 @@ int flag_shared_data;
int flag_delayed_branch;
/* Nonzero if we are compiling pure (sharable) code.
Value is 1 if we are doing reasonable (i.e. simple
offset into offset table) pic. Value is 2 if we can
only perform register offsets. */
int flag_pic;
/* Nonzero means generate extra code for exception handling and enable
exception handling. */
@@ -799,9 +792,6 @@ lang_independent_options f_options[] =
{"optimize-comparisons", &flag_optimize_comparisons, 1,
"Make some comparison operations sequence optimizations"},
/* END CYGNUS LOCAL meissner/nortel */
{"pic", &flag_pic, 1,
"Generate position independent code, if possible"},
{"PIC", &flag_pic, 2, ""},
{"exceptions", &flag_exceptions, 1,
"Enable exception handling" },
{"new-exceptions", &flag_new_exceptions, 1,
@@ -3291,15 +3281,6 @@ rest_of_compilation (decl)
/* Emit code to get eh context, if needed. */
emit_eh_context ();
#ifdef FINALIZE_PIC
/* If we are doing position-independent code generation, now
is the time to output special prologues and epilogues.
We do not want to do this earlier, because it just clutters
up inline functions with meaningless insns. */
if (flag_pic)
FINALIZE_PIC;
#endif
/* From now on, allocate rtl in current_obstack, not in saveable_obstack.
Note that that may have been done above, in save_for_inline_copying.
The call to resume_temporary_allocation near the end of this function

View File

@@ -464,10 +464,7 @@ exception_section ()
#ifdef ASM_OUTPUT_SECTION_NAME
named_section (NULL_TREE, ".gcc_except_table", 0);
#else
if (flag_pic)
data_section ();
else
readonly_data_section ();
readonly_data_section ();
#endif
#endif
}
@@ -2942,8 +2939,7 @@ output_constant_def_contents (exp, reloc, labelno)
#ifdef SELECT_SECTION
SELECT_SECTION (exp, reloc);
#else
if (((TREE_CODE (exp) == STRING_CST) && flag_writable_strings)
|| (flag_pic && reloc))
if ((TREE_CODE (exp) == STRING_CST) && flag_writable_strings)
data_section ();
else
readonly_data_section ();