aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@embecosm.com>2010-06-25 19:00:34 +0000
committerJoern Rennecke <joern.rennecke@embecosm.com>2010-06-25 19:00:34 +0000
commit87346464f14c87ca8ce8faed9ed06c0e2d2eee7b (patch)
tree5e4639118556ab6400163708a3aa76ef93fe0270
parentcbfecfd608a6c73bd444c72ab659ded41f98ff21 (diff)
PR other/44566
* function.h (MACHINE_FUNCTION): Define. * Makefile.in (target-gtypes.h): Add machine_function_u definition. * function.h (struct function): Use machine_function_u for member machine. * function.c (free_after_compilation): Use MACHINE_FUNCTION. (allocate_struct_function): Likewise. * doc/tm.texi: Adjust struct machine_function documentation. * config/alpha/alpha.c (entire file): Replace cfun->machine with MACHINE_FUNCTION (*cfun). * config/xtensa/xtensa.c: Likewise. * config/pa/pa.c: Likewise. * config/mmix/mmix.md: Likewise. * config/mmix/mmix.c: Likewise. * config/sparc/sparc.c: Likewise. * config/bfin/bfin.c: Likewise. * config/moxie/moxie.c: Likewise. * config/ia64/ia64.md: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/m32c/m32c.c: Likewise. * config/cris/cris.c: Likewise. * config/avr/avr.c: Likewise. * config/avr/avr.md: Likewise. * config/iq2000/iq2000.c: Likewise. * config/frv/frv.c: Likewise. * config/mips/mips.h: Likewise. * config/mips/sde.h: Likewise. * config/mips/mips.c: Likewise. * config/s390/s390.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/arm.md: Likewise. * config/arm/arm.h: Likewise. * config/i386/i386.h: Likewise. * config/i386/i386.c: Likewise. * config/i386/cygming.h: Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/multi-target-20100625-branch@161404 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog42
-rw-r--r--gcc/Makefile.in11
-rw-r--r--gcc/config/alpha/alpha.c34
-rw-r--r--gcc/config/arm/arm.c92
-rw-r--r--gcc/config/arm/arm.h4
-rw-r--r--gcc/config/arm/arm.md4
-rw-r--r--gcc/config/avr/avr.c109
-rw-r--r--gcc/config/avr/avr.md18
-rw-r--r--gcc/config/bfin/bfin.c20
-rw-r--r--gcc/config/cris/cris.c30
-rw-r--r--gcc/config/frv/frv.c15
-rw-r--r--gcc/config/i386/cygming.h4
-rw-r--r--gcc/config/i386/i386.c44
-rw-r--r--gcc/config/i386/i386.h18
-rw-r--r--gcc/config/ia64/ia64.c32
-rw-r--r--gcc/config/ia64/ia64.md4
-rw-r--r--gcc/config/iq2000/iq2000.c52
-rw-r--r--gcc/config/m32c/m32c.c60
-rw-r--r--gcc/config/mep/mep.c125
-rw-r--r--gcc/config/mips/mips.c244
-rw-r--r--gcc/config/mips/mips.h5
-rw-r--r--gcc/config/mips/sde.h3
-rw-r--r--gcc/config/mmix/mmix.c17
-rw-r--r--gcc/config/mmix/mmix.md2
-rw-r--r--gcc/config/moxie/moxie.c33
-rw-r--r--gcc/config/pa/pa.c13
-rw-r--r--gcc/config/rs6000/rs6000.c65
-rw-r--r--gcc/config/s390/s390.c100
-rw-r--r--gcc/config/sparc/sparc.c13
-rw-r--r--gcc/config/xtensa/xtensa.c31
-rw-r--r--gcc/doc/tm.texi3
-rw-r--r--gcc/function.c4
-rw-r--r--gcc/function.h5
33 files changed, 690 insertions, 566 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1c3faa6de41..1f794ed5618 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,48 @@
2010-06-24 Joern Rennecke <joern.rennecke@embecosm.com>
PR other/44566
+ * function.h (MACHINE_FUNCTION): Define.
+ * Makefile.in (target-gtypes.h): Add machine_function_u definition.
+
+ * function.h (struct function): Use machine_function_u for member
+ machine.
+ * function.c (free_after_compilation): Use MACHINE_FUNCTION.
+ (allocate_struct_function): Likewise.
+ * doc/tm.texi: Adjust struct machine_function documentation.
+
+ * config/alpha/alpha.c (entire file): Replace cfun->machine with
+ MACHINE_FUNCTION (*cfun).
+ * config/xtensa/xtensa.c: Likewise.
+ * config/pa/pa.c: Likewise.
+ * config/mmix/mmix.md: Likewise.
+ * config/mmix/mmix.c: Likewise.
+ * config/sparc/sparc.c: Likewise.
+ * config/bfin/bfin.c: Likewise.
+ * config/moxie/moxie.c: Likewise.
+ * config/ia64/ia64.md: Likewise.
+ * config/ia64/ia64.c: Likewise.
+ * config/mep/mep.c: Likewise.
+ * config/m32c/m32c.c: Likewise.
+ * config/cris/cris.c: Likewise.
+ * config/avr/avr.c: Likewise.
+ * config/avr/avr.md: Likewise.
+ * config/iq2000/iq2000.c: Likewise.
+ * config/frv/frv.c: Likewise.
+ * config/mips/mips.h: Likewise.
+ * config/mips/sde.h: Likewise.
+ * config/mips/mips.c: Likewise.
+ * config/s390/s390.c: Likewise.
+ * config/rs6000/rs6000.c: Likewise.
+ * config/arm/arm.c: Likewise.
+ * config/arm/arm.md: Likewise.
+ * config/arm/arm.h: Likewise.
+ * config/i386/i386.h: Likewise.
+ * config/i386/i386.c: Likewise.
+ * config/i386/cygming.h: Likewise.
+
+2010-06-24 Joern Rennecke <joern.rennecke@embecosm.com>
+
+ PR other/44566
* function.h (target-gtypes.h): Include.
(struct function): New member target_arch.
* Makefile.in (TARGET_NUM): New Makefile variable.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index a71b16cbb1f..2ada6ee0cbe 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3866,6 +3866,17 @@ s-target-gtypes: Makefile
echo ' CUMULATIVE_ARGS GTY ((tag ("TARGET_NUM"))) _ca;'; \
echo ' } cumulative_args_u;'; \
) > tmp-target-gtypes.h
+ mf_def=` \
+ cat $(tm_include_list) $(filter-out [%], $(GTFILES)) \
+ | sed '/struct[ ]*GTY[() ]*machine_function/!d'`;\
+ (if test "x$${mf_def}" = x; then \
+ echo 'struct GTY (()) machine_function { int dummy; };'; \
+ fi; \
+ echo 'typedef union GTY (())'; \
+ echo ' {' ; \
+ echo ' struct machine_function *GTY ((tag ("TARGET_NUM"))) _mf;'; \
+ echo ' } machine_function_u;' \
+ ) >> tmp-target-gtypes.h
$(SHELL) $(srcdir)/../move-if-change tmp-target-gtypes.h target-gtypes.h
$(STAMP) s-target-gtypes
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 0c46dd226be..8defe229377 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -4849,7 +4849,7 @@ alpha_expand_builtin_establish_vms_condition_handler (rtx target, rtx handler)
slot is needed. In addition to reserving the slot space, this will force
the procedure kind to PT_STACK so ensure that the hard_frame_pointer_rtx
use above is correct. */
- cfun->machine->uses_condition_handler = true;
+ MACHINE_FUNCTION (*cfun)->uses_condition_handler = true;
}
/* Expand code to store the current VMS condition handler into TARGET and
@@ -4885,7 +4885,7 @@ alpha_return_addr (int count, rtx frame ATTRIBUTE_UNUSED)
rtx
alpha_gp_save_rtx (void)
{
- rtx seq, m = cfun->machine->gp_save_rtx;
+ rtx seq, m = MACHINE_FUNCTION (*cfun)->gp_save_rtx;
if (m == NULL)
{
@@ -4906,7 +4906,7 @@ alpha_gp_save_rtx (void)
will call commit_edge_insertions thanks to a kludge. */
insert_insn_on_edge (seq, single_succ_edge (ENTRY_BLOCK_PTR));
- cfun->machine->gp_save_rtx = m;
+ MACHINE_FUNCTION (*cfun)->gp_save_rtx = m;
}
return m;
@@ -5051,7 +5051,7 @@ get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
if (GET_CODE (x) == SYMBOL_REF
&& SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC)
{
- cfun->machine->some_ld_name = XSTR (x, 0);
+ MACHINE_FUNCTION (*cfun)->some_ld_name = XSTR (x, 0);
return 1;
}
@@ -5063,13 +5063,13 @@ get_some_local_dynamic_name (void)
{
rtx insn;
- if (cfun->machine->some_ld_name)
- return cfun->machine->some_ld_name;
+ if (MACHINE_FUNCTION (*cfun)->some_ld_name)
+ return MACHINE_FUNCTION (*cfun)->some_ld_name;
for (insn = get_insns (); insn ; insn = NEXT_INSN (insn))
if (INSN_P (insn)
&& for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0))
- return cfun->machine->some_ld_name;
+ return MACHINE_FUNCTION (*cfun)->some_ld_name;
gcc_unreachable ();
}
@@ -7429,7 +7429,7 @@ alpha_sa_size (void)
/* A VMS condition handler requires a stack procedure in our
implementation. (not required by the calling standard). */
if ((vms_save_fp_regno == -1 && alpha_procedure_type == PT_REGISTER)
- || cfun->machine->uses_condition_handler)
+ || MACHINE_FUNCTION (*cfun)->uses_condition_handler)
vms_base_regno = REG_PV, alpha_procedure_type = PT_STACK;
else if (alpha_procedure_type == PT_NULL)
vms_base_regno = REG_PV;
@@ -7441,7 +7441,7 @@ alpha_sa_size (void)
/* If this is a stack procedure, allow space for saving FP, RA and
a condition handler slot if needed. */
if (alpha_procedure_type == PT_STACK)
- sa_size += 2 + cfun->machine->uses_condition_handler;
+ sa_size += 2 + MACHINE_FUNCTION (*cfun)->uses_condition_handler;
}
else
{
@@ -7804,7 +7804,7 @@ alpha_expand_prologue (void)
+ crtl->args.pretend_args_size));
if (TARGET_ABI_OPEN_VMS)
- reg_offset = 8 + 8 * cfun->machine->uses_condition_handler;
+ reg_offset = 8 + 8 * MACHINE_FUNCTION (*cfun)->uses_condition_handler;
else
reg_offset = ALPHA_ROUND (crtl->outgoing_args_size);
@@ -8142,7 +8142,7 @@ alpha_start_function (FILE *file, const char *fnname,
+ crtl->args.pretend_args_size));
if (TARGET_ABI_OPEN_VMS)
- reg_offset = 8 + 8 * cfun->machine->uses_condition_handler;
+ reg_offset = 8 + 8 * MACHINE_FUNCTION (*cfun)->uses_condition_handler;
else
reg_offset = ALPHA_ROUND (crtl->outgoing_args_size);
@@ -8285,7 +8285,7 @@ alpha_start_function (FILE *file, const char *fnname,
the procedure descriptor bits to point the Condition Handling Facility
at the indirection wrapper, and state the fp offset at which the user
handler may be found. */
- if (cfun->machine->uses_condition_handler)
+ if (MACHINE_FUNCTION (*cfun)->uses_condition_handler)
{
fprintf (file, "\t.handler __gcc_shell_handler\n");
fprintf (file, "\t.handler_data %d\n", VMS_COND_HANDLER_FP_OFFSET);
@@ -8362,7 +8362,7 @@ alpha_expand_epilogue (void)
if (TARGET_ABI_OPEN_VMS)
{
if (alpha_procedure_type == PT_STACK)
- reg_offset = 8 + 8 * cfun->machine->uses_condition_handler;
+ reg_offset = 8 + 8 * MACHINE_FUNCTION (*cfun)->uses_condition_handler;
else
reg_offset = 0;
}
@@ -10427,7 +10427,7 @@ unicosmk_output_align (FILE *file, int align)
void
unicosmk_defer_case_vector (rtx lab, rtx vec)
{
- struct machine_function *machine = cfun->machine;
+ struct machine_function *machine = MACHINE_FUNCTION (*cfun);
vec = gen_rtx_EXPR_LIST (VOIDmode, lab, vec);
machine->addr_list = gen_rtx_EXPR_LIST (VOIDmode, vec,
@@ -10458,7 +10458,7 @@ unicosmk_output_addr_vec (FILE *file, rtx vec)
static void
unicosmk_output_deferred_case_vectors (FILE *file)
{
- struct machine_function *machine = cfun->machine;
+ struct machine_function *machine = MACHINE_FUNCTION (*cfun);
rtx t;
if (machine->addr_list == NULL_RTX)
@@ -10578,7 +10578,7 @@ unicosmk_output_ssib (FILE *file, const char *fnname)
int i;
rtx x;
rtx ciw;
- struct machine_function *machine = cfun->machine;
+ struct machine_function *machine = MACHINE_FUNCTION (*cfun);
in_section = NULL;
fprintf (file, "\t.endp\n\n\t.psect\t%s%s,data\n", user_label_prefix,
@@ -10637,7 +10637,7 @@ rtx
unicosmk_add_call_info_word (rtx x)
{
rtx node;
- struct machine_function *machine = cfun->machine;
+ struct machine_function *machine = MACHINE_FUNCTION (*cfun);
node = gen_rtx_EXPR_LIST (VOIDmode, x, NULL_RTX);
if (machine->first_ciw == NULL_RTX)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index b5aa0a617ad..3460aadda64 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -1989,10 +1989,10 @@ arm_compute_func_type (void)
unsigned long
arm_current_func_type (void)
{
- if (ARM_FUNC_TYPE (cfun->machine->func_type) == ARM_FT_UNKNOWN)
- cfun->machine->func_type = arm_compute_func_type ();
+ if (ARM_FUNC_TYPE (MACHINE_FUNCTION (*cfun)->func_type) == ARM_FT_UNKNOWN)
+ MACHINE_FUNCTION (*cfun)->func_type = arm_compute_func_type ();
- return cfun->machine->func_type;
+ return MACHINE_FUNCTION (*cfun)->func_type;
}
bool
@@ -2115,7 +2115,7 @@ use_return_insn (int iscond, rtx sibling)
/* As do variadic functions. */
if (crtl->args.pretend_args_size
- || cfun->machine->uses_anonymous_args
+ || MACHINE_FUNCTION (*cfun)->uses_anonymous_args
/* Or if the function calls __builtin_eh_return () */
|| crtl->calls_eh_return
/* Or if the function calls alloca */
@@ -4778,7 +4778,7 @@ arm_function_ok_for_sibcall (tree decl, tree exp)
{
unsigned long func_type;
- if (cfun->machine->sibcall_blocked)
+ if (MACHINE_FUNCTION (*cfun)->sibcall_blocked)
return false;
/* Never tailcall something for which we have no decl, or if we
@@ -4848,7 +4848,7 @@ legitimate_pic_operand_p (rtx x)
}
/* Record that the current function needs a PIC register. Initialize
- cfun->machine->pic_reg if we have not already done so. */
+ MACHINE_FUNCTION (*cfun)->pic_reg if we have not already done so. */
static void
require_pic_register (void)
@@ -4863,8 +4863,9 @@ require_pic_register (void)
gcc_assert (can_create_pseudo_p ());
if (arm_pic_register != INVALID_REGNUM)
{
- if (!cfun->machine->pic_reg)
- cfun->machine->pic_reg = gen_rtx_REG (Pmode, arm_pic_register);
+ if (!MACHINE_FUNCTION (*cfun)->pic_reg)
+ MACHINE_FUNCTION (*cfun)->pic_reg
+ = gen_rtx_REG (Pmode, arm_pic_register);
/* Play games to avoid marking the function as needing pic
if we are being called as part of the cost-estimation
@@ -4876,8 +4877,8 @@ require_pic_register (void)
{
rtx seq;
- if (!cfun->machine->pic_reg)
- cfun->machine->pic_reg = gen_reg_rtx (Pmode);
+ if (!MACHINE_FUNCTION (*cfun)->pic_reg)
+ MACHINE_FUNCTION (*cfun)->pic_reg = gen_reg_rtx (Pmode);
/* Play games to avoid marking the function as needing pic
if we are being called as part of the cost-estimation
@@ -4941,9 +4942,11 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
else /* TARGET_THUMB1 */
emit_insn (gen_pic_load_addr_thumb1 (address, orig));
- pic_ref = gen_const_mem (Pmode,
- gen_rtx_PLUS (Pmode, cfun->machine->pic_reg,
- address));
+ pic_ref
+ = gen_const_mem (Pmode,
+ gen_rtx_PLUS (Pmode,
+ MACHINE_FUNCTION (*cfun)->pic_reg,
+ address));
insn = emit_move_insn (reg, pic_ref);
}
@@ -4958,7 +4961,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
rtx base, offset;
if (GET_CODE (XEXP (orig, 0)) == PLUS
- && XEXP (XEXP (orig, 0), 0) == cfun->machine->pic_reg)
+ && XEXP (XEXP (orig, 0), 0) == MACHINE_FUNCTION (*cfun)->pic_reg)
return orig;
/* Handle the case where we have: const (UNSPEC_TLS). */
@@ -5040,7 +5043,7 @@ thumb_find_work_register (unsigned long pushed_regs_mask)
pushed right at the start of the function. Hence it will be available
for the rest of the prologue.
(*): ie crtl->args.pretend_args_size is greater than 0. */
- if (cfun->machine->uses_anonymous_args
+ if (MACHINE_FUNCTION (*cfun)->uses_anonymous_args
&& crtl->args.pretend_args_size > 0)
return LAST_ARG_REGNUM;
@@ -5056,7 +5059,7 @@ thumb_find_work_register (unsigned long pushed_regs_mask)
function but which are not used. Hence we could miss an opportunity
when a function has an unused argument in r3. But it is better to be
safe than to be sorry. */
- if (! cfun->machine->uses_anonymous_args
+ if (! MACHINE_FUNCTION (*cfun)->uses_anonymous_args
&& crtl->args.size >= 0
&& crtl->args.size <= (LAST_ARG_REGNUM * UNITS_PER_WORD)
&& INCOMING_ARGS_INFO (crtl->args).nregs < 4)
@@ -5094,7 +5097,7 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED)
gcc_assert (flag_pic);
- pic_reg = cfun->machine->pic_reg;
+ pic_reg = MACHINE_FUNCTION (*cfun)->pic_reg;
if (TARGET_VXWORKS_RTP)
{
pic_rtx = gen_rtx_SYMBOL_REF (Pmode, VXWORKS_GOTT_BASE);
@@ -11916,7 +11919,8 @@ arm_emit_call_insn (rtx pat, rtx addr)
: !SYMBOL_REF_LOCAL_P (addr)))
{
require_pic_register ();
- use_reg (&CALL_INSN_FUNCTION_USAGE (insn), cfun->machine->pic_reg);
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn),
+ MACHINE_FUNCTION (*cfun)->pic_reg);
}
}
@@ -13122,7 +13126,7 @@ arm_compute_save_reg_mask (void)
&& !crtl->calls_eh_return))
save_reg_mask |= 1 << LR_REGNUM;
- if (cfun->machine->lr_save_eliminated)
+ if (MACHINE_FUNCTION (*cfun)->lr_save_eliminated)
save_reg_mask &= ~ (1 << LR_REGNUM);
if (TARGET_REALLY_IWMMXT
@@ -13148,7 +13152,7 @@ arm_compute_save_reg_mask (void)
save_reg_mask |= (1 << reg);
else
{
- cfun->machine->sibcall_blocked = 1;
+ MACHINE_FUNCTION (*cfun)->sibcall_blocked = 1;
save_reg_mask |= (1 << 3);
}
}
@@ -13322,7 +13326,7 @@ output_return_instruction (rtx operand, int really_return, int reverse)
sprintf (conditional, "%%?%%%c0", reverse ? 'D' : 'd');
- cfun->machine->return_used_this_function = 1;
+ MACHINE_FUNCTION (*cfun)->return_used_this_function = 1;
offsets = arm_get_frame_offsets ();
live_regs_mask = offsets->saved_regs_mask;
@@ -13589,9 +13593,9 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size)
asm_fprintf (f, "\t%@ frame_needed = %d, uses_anonymous_args = %d\n",
frame_pointer_needed,
- cfun->machine->uses_anonymous_args);
+ MACHINE_FUNCTION (*cfun)->uses_anonymous_args);
- if (cfun->machine->lr_save_eliminated)
+ if (MACHINE_FUNCTION (*cfun)->lr_save_eliminated)
asm_fprintf (f, "\t%@ link register save eliminated.\n");
if (crtl->calls_eh_return)
@@ -13618,7 +13622,7 @@ arm_output_epilogue (rtx sibling)
/* If we have already generated the return instruction
then it is futile to generate anything else. */
if (use_return_insn (FALSE, sibling) &&
- (cfun->machine->return_used_this_function != 0))
+ (MACHINE_FUNCTION (*cfun)->return_used_this_function != 0))
return "";
func_type = arm_current_func_type ();
@@ -14056,7 +14060,7 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
of call_reg and call_value_reg type insns. */
for (regno = 0; regno < LR_REGNUM; regno++)
{
- rtx label = cfun->machine->call_via[regno];
+ rtx label = MACHINE_FUNCTION (*cfun)->call_via[regno];
if (label != NULL)
{
@@ -14070,7 +14074,7 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
/* ??? Probably not safe to set this here, since it assumes that a
function will be emitted as assembly immediately after we generate
RTL for it. This does not happen for inline functions. */
- cfun->machine->return_used_this_function = 0;
+ MACHINE_FUNCTION (*cfun)->return_used_this_function = 0;
}
else /* TARGET_32BIT */
{
@@ -14078,7 +14082,7 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
offsets = arm_get_frame_offsets ();
gcc_assert (!use_return_insn (FALSE, NULL)
- || (cfun->machine->return_used_this_function != 0)
+ || (MACHINE_FUNCTION (*cfun)->return_used_this_function != 0)
|| offsets->saved_regs == offsets->outgoing_args
|| frame_pointer_needed);
@@ -14307,7 +14311,7 @@ emit_sfm (int base_reg, int count)
static bool
thumb_force_lr_save (void)
{
- return !cfun->machine->lr_save_eliminated
+ return !MACHINE_FUNCTION (*cfun)->lr_save_eliminated
&& (!leaf_function_p ()
|| thumb_far_jump_used_p ()
|| df_regs_ever_live_p (LR_REGNUM));
@@ -14378,7 +14382,7 @@ arm_get_frame_offsets (void)
HOST_WIDE_INT frame_size;
int i;
- offsets = &cfun->machine->stack_offsets;
+ offsets = &MACHINE_FUNCTION (*cfun)->stack_offsets;
/* We need to know if we are a leaf function. Unfortunately, it
is possible to be called after start_sequence has been called,
@@ -14870,7 +14874,7 @@ arm_expand_prologue (void)
else
{
/* Store the args on the stack. */
- if (cfun->machine->uses_anonymous_args)
+ if (MACHINE_FUNCTION (*cfun)->uses_anonymous_args)
insn = emit_multi_reg_push
((0xf0 >> (args_to_push / 4)) & 0xf);
else
@@ -14897,7 +14901,7 @@ arm_expand_prologue (void)
if (args_to_push)
{
/* Push the argument registers, or reserve space for them. */
- if (cfun->machine->uses_anonymous_args)
+ if (MACHINE_FUNCTION (*cfun)->uses_anonymous_args)
insn = emit_multi_reg_push
((0xf0 >> (args_to_push / 4)) & 0xf);
else
@@ -15039,7 +15043,7 @@ arm_expand_prologue (void)
/* If the link register is being kept alive, with the return address in it,
then make sure that it does not get reused by the ce2 pass. */
if ((live_regs_mask & (1 << LR_REGNUM)) == 0)
- cfun->machine->lr_save_eliminated = 1;
+ MACHINE_FUNCTION (*cfun)->lr_save_eliminated = 1;
}
/* Print condition code to STREAM. Helper function for arm_print_operand. */
@@ -19236,7 +19240,7 @@ thumb_far_jump_used_p (void)
it turns out that they are not being used. Once we have made
the decision that far jumps are present (and that hence the link
register will be pushed onto the stack) we cannot go back on it. */
- if (cfun->machine->far_jump_used)
+ if (MACHINE_FUNCTION (*cfun)->far_jump_used)
return 1;
/* If this function is not being called from the prologue/epilogue
@@ -19266,8 +19270,8 @@ thumb_far_jump_used_p (void)
If we need doubleword stack alignment this could affect the other
elimination offsets so we can't risk getting it wrong. */
if (df_regs_ever_live_p (ARG_POINTER_REGNUM))
- cfun->machine->arg_pointer_live = 1;
- else if (!cfun->machine->arg_pointer_live)
+ MACHINE_FUNCTION (*cfun)->arg_pointer_live = 1;
+ else if (!MACHINE_FUNCTION (*cfun)->arg_pointer_live)
return 0;
}
@@ -19284,7 +19288,7 @@ thumb_far_jump_used_p (void)
{
/* Record the fact that we have decided that
the function does use far jumps. */
- cfun->machine->far_jump_used = 1;
+ MACHINE_FUNCTION (*cfun)->far_jump_used = 1;
return 1;
}
}
@@ -19320,7 +19324,7 @@ thumb_unexpanded_epilogue (void)
int had_to_push_lr;
int size;
- if (cfun->machine->return_used_this_function != 0)
+ if (MACHINE_FUNCTION (*cfun)->return_used_this_function != 0)
return "";
if (IS_NAKED (arm_current_func_type ()))
@@ -19706,9 +19710,9 @@ thumb1_expand_prologue (void)
|| (ARM_EABI_UNWIND_TABLES && cfun->can_throw_non_call_exceptions))
emit_insn (gen_blockage ());
- cfun->machine->lr_save_eliminated = !thumb_force_lr_save ();
+ MACHINE_FUNCTION (*cfun)->lr_save_eliminated = !thumb_force_lr_save ();
if (live_regs_mask & 0xff)
- cfun->machine->lr_save_eliminated = 0;
+ MACHINE_FUNCTION (*cfun)->lr_save_eliminated = 0;
}
@@ -19819,7 +19823,7 @@ thumb1_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
fprintf (f, "\t.pad #%d\n",
crtl->args.pretend_args_size);
- if (cfun->machine->uses_anonymous_args)
+ if (MACHINE_FUNCTION (*cfun)->uses_anonymous_args)
{
int num_pushes;
@@ -20199,9 +20203,9 @@ thumb_call_via_reg (rtx reg)
}
else
{
- if (cfun->machine->call_via[regno] == NULL)
- cfun->machine->call_via[regno] = gen_label_rtx ();
- labelp = cfun->machine->call_via + regno;
+ if (MACHINE_FUNCTION (*cfun)->call_via[regno] == NULL)
+ MACHINE_FUNCTION (*cfun)->call_via[regno] = gen_label_rtx ();
+ labelp = MACHINE_FUNCTION (*cfun)->call_via + regno;
}
output_asm_insn ("bl\t%a0", labelp);
@@ -20690,7 +20694,7 @@ arm_setup_incoming_varargs (CUMULATIVE_ARGS *pcum,
{
int nregs;
- cfun->machine->uses_anonymous_args = 1;
+ MACHINE_FUNCTION (*cfun)->uses_anonymous_args = 1;
if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL)
{
nregs = pcum->aapcs_ncrn;
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 9066bbefb61..d7de9e54680 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1131,8 +1131,8 @@ extern int arm_structure_size_boundary;
saved by the prologue, even if they would normally be
call-clobbered. */
#define HARD_REGNO_RENAME_OK(SRC, DST) \
- (! IS_INTERRUPT (cfun->machine->func_type) || \
- df_regs_ever_live_p (DST))
+ (! IS_INTERRUPT (MACHINE_FUNCTION (*cfun)->func_type) \
+ || df_regs_ever_live_p (DST))
/* Register and constant classes. */
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 1608929c95d..18cead4ef64 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -10661,7 +10661,7 @@
"TARGET_EITHER"
"
{
- cfun->machine->eh_epilogue_sp_ofs = operands[1];
+ MACHINE_FUNCTION (*cfun)->eh_epilogue_sp_ofs = operands[1];
if (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != 2)
{
rtx ra = gen_rtx_REG (Pmode, 2);
@@ -10671,7 +10671,7 @@
}
/* This is a hack -- we may have crystalized the function type too
early. */
- cfun->machine->func_type = 0;
+ MACHINE_FUNCTION (*cfun)->func_type = 0;
}"
)
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index 548c3dd7133..745c7f5a10a 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -342,8 +342,8 @@ avr_regs_to_save (HARD_REG_SET *set)
/* No need to save any registers if the function never returns or
is have "OS_task" or "OS_main" attribute. */
if (TREE_THIS_VOLATILE (current_function_decl)
- || cfun->machine->is_OS_task
- || cfun->machine->is_OS_main)
+ || MACHINE_FUNCTION (*cfun)->is_OS_task
+ || MACHINE_FUNCTION (*cfun)->is_OS_main)
return 0;
for (reg = 0; reg < 32; reg++)
@@ -524,16 +524,21 @@ expand_prologue (void)
gen_rtx_POST_DEC (HImode, stack_pointer_rtx));
rtx insn;
- /* Init cfun->machine. */
- cfun->machine->is_naked = avr_naked_function_p (current_function_decl);
- cfun->machine->is_interrupt = interrupt_function_p (current_function_decl);
- cfun->machine->is_signal = signal_function_p (current_function_decl);
- cfun->machine->is_OS_task = avr_OS_task_function_p (current_function_decl);
- cfun->machine->is_OS_main = avr_OS_main_function_p (current_function_decl);
- cfun->machine->stack_usage = 0;
+ /* Init MACHINE_FUNCTION (*cfun). */
+ MACHINE_FUNCTION (*cfun)->is_naked
+ = avr_naked_function_p (current_function_decl);
+ MACHINE_FUNCTION (*cfun)->is_interrupt
+ = interrupt_function_p (current_function_decl);
+ MACHINE_FUNCTION (*cfun)->is_signal
+ = signal_function_p (current_function_decl);
+ MACHINE_FUNCTION (*cfun)->is_OS_task
+ = avr_OS_task_function_p (current_function_decl);
+ MACHINE_FUNCTION (*cfun)->is_OS_main
+ = avr_OS_main_function_p (current_function_decl);
+ MACHINE_FUNCTION (*cfun)->stack_usage = 0;
/* Prologue: naked. */
- if (cfun->machine->is_naked)
+ if (MACHINE_FUNCTION (*cfun)->is_naked)
{
return;
}
@@ -541,15 +546,16 @@ expand_prologue (void)
avr_regs_to_save (&set);
live_seq = sequent_regs_live ();
minimize = (TARGET_CALL_PROLOGUES
- && !cfun->machine->is_interrupt
- && !cfun->machine->is_signal
- && !cfun->machine->is_OS_task
- && !cfun->machine->is_OS_main
+ && !MACHINE_FUNCTION (*cfun)->is_interrupt
+ && !MACHINE_FUNCTION (*cfun)->is_signal
+ && !MACHINE_FUNCTION (*cfun)->is_OS_task
+ && !MACHINE_FUNCTION (*cfun)->is_OS_main
&& live_seq);
- if (cfun->machine->is_interrupt || cfun->machine->is_signal)
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt
+ || MACHINE_FUNCTION (*cfun)->is_signal)
{
- if (cfun->machine->is_interrupt)
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt)
{
/* Enable interrupts. */
insn = emit_insn (gen_enable_interrupt ());
@@ -559,12 +565,12 @@ expand_prologue (void)
/* Push zero reg. */
insn = emit_move_insn (pushbyte, zero_reg_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
- cfun->machine->stack_usage++;
+ MACHINE_FUNCTION (*cfun)->stack_usage++;
/* Push tmp reg. */
insn = emit_move_insn (pushbyte, tmp_reg_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
- cfun->machine->stack_usage++;
+ MACHINE_FUNCTION (*cfun)->stack_usage++;
/* Push SREG. */
insn = emit_move_insn (tmp_reg_rtx,
@@ -572,7 +578,7 @@ expand_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
insn = emit_move_insn (pushbyte, tmp_reg_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
- cfun->machine->stack_usage++;
+ MACHINE_FUNCTION (*cfun)->stack_usage++;
/* Push RAMPZ. */
if(AVR_HAVE_RAMPZ
@@ -583,7 +589,7 @@ expand_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
insn = emit_move_insn (pushbyte, tmp_reg_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
- cfun->machine->stack_usage++;
+ MACHINE_FUNCTION (*cfun)->stack_usage++;
}
/* Clear zero reg. */
@@ -605,7 +611,7 @@ expand_prologue (void)
emit_insn (gen_call_prologue_saves (gen_int_mode (live_seq, HImode),
gen_int_mode (size + live_seq, HImode)));
RTX_FRAME_RELATED_P (insn) = 1;
- cfun->machine->stack_usage += size + live_seq;
+ MACHINE_FUNCTION (*cfun)->stack_usage += size + live_seq;
}
else
{
@@ -617,17 +623,18 @@ expand_prologue (void)
/* Emit push of register to save. */
insn=emit_move_insn (pushbyte, gen_rtx_REG (QImode, reg));
RTX_FRAME_RELATED_P (insn) = 1;
- cfun->machine->stack_usage++;
+ MACHINE_FUNCTION (*cfun)->stack_usage++;
}
}
if (frame_pointer_needed)
{
- if (!(cfun->machine->is_OS_task || cfun->machine->is_OS_main))
+ if (!(MACHINE_FUNCTION (*cfun)->is_OS_task
+ || MACHINE_FUNCTION (*cfun)->is_OS_main))
{
/* Push frame pointer. */
insn = emit_move_insn (pushword, frame_pointer_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
- cfun->machine->stack_usage += 2;
+ MACHINE_FUNCTION (*cfun)->stack_usage += 2;
}
if (!size)
@@ -684,15 +691,15 @@ expand_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
}
else if (TARGET_NO_INTERRUPTS
- || cfun->machine->is_signal
- || cfun->machine->is_OS_main)
+ || MACHINE_FUNCTION (*cfun)->is_signal
+ || MACHINE_FUNCTION (*cfun)->is_OS_main)
{
insn =
emit_insn (gen_movhi_sp_r_irq_off (stack_pointer_rtx,
frame_pointer_rtx));
RTX_FRAME_RELATED_P (insn) = 1;
}
- else if (cfun->machine->is_interrupt)
+ else if (MACHINE_FUNCTION (*cfun)->is_interrupt)
{
insn = emit_insn (gen_movhi_sp_r_irq_on (stack_pointer_rtx,
frame_pointer_rtx));
@@ -734,7 +741,7 @@ expand_prologue (void)
emit_insn (sp_plus_insns);
else
emit_insn (fp_plus_insns);
- cfun->machine->stack_usage += size;
+ MACHINE_FUNCTION (*cfun)->stack_usage += size;
}
}
}
@@ -745,17 +752,17 @@ expand_prologue (void)
static void
avr_asm_function_end_prologue (FILE *file)
{
- if (cfun->machine->is_naked)
+ if (MACHINE_FUNCTION (*cfun)->is_naked)
{
fputs ("/* prologue: naked */\n", file);
}
else
{
- if (cfun->machine->is_interrupt)
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt)
{
fputs ("/* prologue: Interrupt */\n", file);
}
- else if (cfun->machine->is_signal)
+ else if (MACHINE_FUNCTION (*cfun)->is_signal)
{
fputs ("/* prologue: Signal */\n", file);
}
@@ -765,10 +772,11 @@ avr_asm_function_end_prologue (FILE *file)
fprintf (file, "/* frame size = " HOST_WIDE_INT_PRINT_DEC " */\n",
get_frame_size());
fprintf (file, "/* stack size = %d */\n",
- cfun->machine->stack_usage);
+ MACHINE_FUNCTION (*cfun)->stack_usage);
/* Create symbol stack offset here so all functions have it. Add 1 to stack
usage for offset so that SP + .L__stack_offset = return address. */
- fprintf (file, ".L__stack_usage = %d\n", cfun->machine->stack_usage);
+ fprintf (file, ".L__stack_usage = %d\n",
+ MACHINE_FUNCTION (*cfun)->stack_usage);
}
@@ -778,8 +786,9 @@ int
avr_epilogue_uses (int regno ATTRIBUTE_UNUSED)
{
if (reload_completed
- && cfun->machine
- && (cfun->machine->is_interrupt || cfun->machine->is_signal))
+ && MACHINE_FUNCTION (*cfun)
+ && (MACHINE_FUNCTION (*cfun)->is_interrupt
+ || MACHINE_FUNCTION (*cfun)->is_signal))
return 1;
return 0;
}
@@ -796,7 +805,7 @@ expand_epilogue (void)
HOST_WIDE_INT size = get_frame_size();
/* epilogue: naked */
- if (cfun->machine->is_naked)
+ if (MACHINE_FUNCTION (*cfun)->is_naked)
{
emit_jump_insn (gen_return ());
return;
@@ -805,10 +814,10 @@ expand_epilogue (void)
avr_regs_to_save (&set);
live_seq = sequent_regs_live ();
minimize = (TARGET_CALL_PROLOGUES
- && !cfun->machine->is_interrupt
- && !cfun->machine->is_signal
- && !cfun->machine->is_OS_task
- && !cfun->machine->is_OS_main
+ && !MACHINE_FUNCTION (*cfun)->is_interrupt
+ && !MACHINE_FUNCTION (*cfun)->is_signal
+ && !MACHINE_FUNCTION (*cfun)->is_OS_task
+ && !MACHINE_FUNCTION (*cfun)->is_OS_main
&& live_seq);
if (minimize && (frame_pointer_needed || live_seq > 4))
@@ -864,12 +873,12 @@ expand_epilogue (void)
emit_move_insn (stack_pointer_rtx, frame_pointer_rtx);
}
else if (TARGET_NO_INTERRUPTS
- || cfun->machine->is_signal)
+ || MACHINE_FUNCTION (*cfun)->is_signal)
{
emit_insn (gen_movhi_sp_r_irq_off (stack_pointer_rtx,
frame_pointer_rtx));
}
- else if (cfun->machine->is_interrupt)
+ else if (MACHINE_FUNCTION (*cfun)->is_interrupt)
{
emit_insn (gen_movhi_sp_r_irq_on (stack_pointer_rtx,
frame_pointer_rtx));
@@ -903,7 +912,8 @@ expand_epilogue (void)
else
emit_insn (fp_plus_insns);
}
- if (!(cfun->machine->is_OS_task || cfun->machine->is_OS_main))
+ if (!(MACHINE_FUNCTION (*cfun)->is_OS_task
+ || MACHINE_FUNCTION (*cfun)->is_OS_main))
{
/* Restore previous frame_pointer. */
emit_insn (gen_pophi (frame_pointer_rtx));
@@ -915,7 +925,8 @@ expand_epilogue (void)
if (TEST_HARD_REG_BIT (set, reg))
emit_insn (gen_popqi (gen_rtx_REG (QImode, reg)));
}
- if (cfun->machine->is_interrupt || cfun->machine->is_signal)
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt
+ || MACHINE_FUNCTION (*cfun)->is_signal)
{
/* Restore RAMPZ using tmp reg as scratch. */
if(AVR_HAVE_RAMPZ
@@ -4642,7 +4653,7 @@ avr_asm_declare_function_name (FILE *file, const char *name, tree decl)
make sure that the name of the function is "__vector_NN" so as to
catch when the user misspells the interrupt vector name. */
- if (cfun->machine->is_interrupt)
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt)
{
if (strncmp (name, "__vector", strlen ("__vector")) != 0)
{
@@ -4651,7 +4662,7 @@ avr_asm_declare_function_name (FILE *file, const char *name, tree decl)
name);
}
}
- else if (cfun->machine->is_signal)
+ else if (MACHINE_FUNCTION (*cfun)->is_signal)
{
if (strncmp (name, "__vector", strlen ("__vector")) != 0)
{
@@ -6011,7 +6022,8 @@ avr_hard_regno_scratch_ok (unsigned int regno)
/* Interrupt functions can only use registers that have already been saved
by the prologue, even if they would normally be call-clobbered. */
- if ((cfun->machine->is_interrupt || cfun->machine->is_signal)
+ if ((MACHINE_FUNCTION (*cfun)->is_interrupt
+ || MACHINE_FUNCTION (*cfun)->is_signal)
&& !df_regs_ever_live_p (regno))
return false;
@@ -6028,7 +6040,8 @@ avr_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED,
saved by the prologue, even if they would normally be
call-clobbered. */
- if ((cfun->machine->is_interrupt || cfun->machine->is_signal)
+ if ((MACHINE_FUNCTION (*cfun)->is_interrupt
+ || MACHINE_FUNCTION (*cfun)->is_signal)
&& !df_regs_ever_live_p (new_reg))
return 0;
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index 70b773532ab..0c96c0a17c2 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -3203,9 +3203,10 @@
(define_insn "return_from_epilogue"
[(return)]
"(reload_completed
- && cfun->machine
- && !(cfun->machine->is_interrupt || cfun->machine->is_signal)
- && !cfun->machine->is_naked)"
+ && MACHINE_FUNCTION (*cfun)
+ && !(MACHINE_FUNCTION (*cfun)->is_interrupt
+ || MACHINE_FUNCTION (*cfun)->is_signal)
+ && !MACHINE_FUNCTION (*cfun)->is_naked)"
"ret"
[(set_attr "cc" "none")
(set_attr "length" "1")])
@@ -3213,9 +3214,10 @@
(define_insn "return_from_interrupt_epilogue"
[(return)]
"(reload_completed
- && cfun->machine
- && (cfun->machine->is_interrupt || cfun->machine->is_signal)
- && !cfun->machine->is_naked)"
+ && MACHINE_FUNCTION (*cfun)
+ && (MACHINE_FUNCTION (*cfun)->is_interrupt
+ || MACHINE_FUNCTION (*cfun)->is_signal)
+ && !MACHINE_FUNCTION (*cfun)->is_naked)"
"reti"
[(set_attr "cc" "none")
(set_attr "length" "1")])
@@ -3223,8 +3225,8 @@
(define_insn "return_from_naked_epilogue"
[(return)]
"(reload_completed
- && cfun->machine
- && cfun->machine->is_naked)"
+ && MACHINE_FUNCTION (*cfun)
+ && MACHINE_FUNCTION (*cfun)->is_naked)"
""
[(set_attr "cc" "none")
(set_attr "length" "0")])
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index c187bf3bbc7..b5a8f340eb4 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -618,8 +618,8 @@ expand_prologue_reg_save (rtx spreg, int saveall, bool is_inthandler)
RTX_FRAME_RELATED_P (insn) = 1;
for (dregno = REG_LT0; dregno <= REG_LB1; dregno++)
if (! current_function_is_leaf
- || cfun->machine->has_hardware_loops
- || cfun->machine->has_loopreg_clobber
+ || MACHINE_FUNCTION (*cfun)->has_hardware_loops
+ || MACHINE_FUNCTION (*cfun)->has_loopreg_clobber
|| (ENABLE_WA_05000257
&& (dregno == REG_LC0 || dregno == REG_LC1)))
{
@@ -798,8 +798,8 @@ expand_epilogue_reg_restore (rtx spreg, bool saveall, bool is_inthandler)
{
for (regno = REG_LB1; regno >= REG_LT0; regno--)
if (! current_function_is_leaf
- || cfun->machine->has_hardware_loops
- || cfun->machine->has_loopreg_clobber
+ || MACHINE_FUNCTION (*cfun)->has_hardware_loops
+ || MACHINE_FUNCTION (*cfun)->has_loopreg_clobber
|| (ENABLE_WA_05000257 && (regno == REG_LC0 || regno == REG_LC1)))
emit_move_insn (gen_rtx_REG (SImode, regno), postinc);
@@ -906,8 +906,8 @@ n_regs_saved_by_prologue (void)
/* Increment once for ASTAT. */
n++;
if (! current_function_is_leaf
- || cfun->machine->has_hardware_loops
- || cfun->machine->has_loopreg_clobber)
+ || MACHINE_FUNCTION (*cfun)->has_hardware_loops
+ || MACHINE_FUNCTION (*cfun)->has_loopreg_clobber)
{
n += 6;
}
@@ -3550,7 +3550,7 @@ bfin_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp)
countreg = copy_to_mode_reg (Pmode, GEN_INT (new_count));
emit_insn (gen_rep_movsi (destreg, srcreg, countreg, destreg, srcreg));
- cfun->machine->has_loopreg_clobber = true;
+ MACHINE_FUNCTION (*cfun)->has_loopreg_clobber = true;
}
if (count & 2)
{
@@ -3571,7 +3571,7 @@ bfin_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp)
countreg = copy_to_mode_reg (Pmode, GEN_INT (new_count));
emit_insn (gen_rep_movhi (destreg, srcreg, countreg, destreg, srcreg));
- cfun->machine->has_loopreg_clobber = true;
+ MACHINE_FUNCTION (*cfun)->has_loopreg_clobber = true;
}
}
if (count & 1)
@@ -3680,7 +3680,7 @@ find_prev_insn_start (rtx insn)
void
bfin_hardware_loop (void)
{
- cfun->machine->has_hardware_loops++;
+ MACHINE_FUNCTION (*cfun)->has_hardware_loops++;
}
/* Maximum loop nesting depth. */
@@ -5510,7 +5510,7 @@ bfin_reorg (void)
df_analyze ();
/* Doloop optimization */
- if (cfun->machine->has_hardware_loops)
+ if (MACHINE_FUNCTION (*cfun)->has_hardware_loops)
bfin_reorg_loops (dump_file);
workaround_speculation ();
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 0dc18c7802b..4d881b44aef 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -1188,7 +1188,7 @@ cris_print_operand_address (FILE *file, rtx x)
rtx
cris_return_addr_rtx (int count, rtx frameaddr ATTRIBUTE_UNUSED)
{
- cfun->machine->needs_return_address_on_stack = 1;
+ MACHINE_FUNCTION (*cfun)->needs_return_address_on_stack = 1;
/* The return-address is stored just above the saved frame-pointer (if
present). Apparently we can't eliminate from the frame-pointer in
@@ -1198,23 +1198,23 @@ cris_return_addr_rtx (int count, rtx frameaddr ATTRIBUTE_UNUSED)
: NULL_RTX;
}
-/* Accessor used in cris.md:return because cfun->machine isn't available
- there. */
+/* Accessor used in cris.md:return because
+ MACHINE_FUNCTION (*cfun) isn't available there. */
bool
cris_return_address_on_stack (void)
{
return df_regs_ever_live_p (CRIS_SRP_REGNUM)
- || cfun->machine->needs_return_address_on_stack;
+ || MACHINE_FUNCTION (*cfun)->needs_return_address_on_stack;
}
-/* Accessor used in cris.md:return because cfun->machine isn't available
- there. */
+/* Accessor used in cris.md:return because
+ MACHINE_FUNCTION (*cfun) isn't available there. */
bool
cris_return_address_on_stack_for_return (void)
{
- return cfun->machine->return_type == CRIS_RETINSN_RET ? false
+ return MACHINE_FUNCTION (*cfun)->return_type == CRIS_RETINSN_RET ? false
: cris_return_address_on_stack ();
}
@@ -1791,10 +1791,12 @@ cris_expand_return (bool on_stack)
to check that it doesn't change half-way through. */
emit_jump_insn (gen_rtx_RETURN (VOIDmode));
- CRIS_ASSERT (cfun->machine->return_type != CRIS_RETINSN_RET || !on_stack);
- CRIS_ASSERT (cfun->machine->return_type != CRIS_RETINSN_JUMP || on_stack);
+ CRIS_ASSERT (MACHINE_FUNCTION (*cfun)->return_type != CRIS_RETINSN_RET
+ || !on_stack);
+ CRIS_ASSERT (MACHINE_FUNCTION (*cfun)->return_type != CRIS_RETINSN_JUMP
+ || on_stack);
- cfun->machine->return_type
+ MACHINE_FUNCTION (*cfun)->return_type
= on_stack ? CRIS_RETINSN_JUMP : CRIS_RETINSN_RET;
}
@@ -2838,14 +2840,14 @@ cris_expand_prologue (void)
if (pretend)
{
/* See also cris_setup_incoming_varargs where
- cfun->machine->stdarg_regs is set. There are other setters of
- crtl->args.pretend_args_size than stdarg handling, like
+ MACHINE_FUNCTION (*cfun)->stdarg_regs is set. There are other
+ setters of crtl->args.pretend_args_size than stdarg handling, like
for an argument passed with parts in R13 and stack. We must
not store R13 into the pretend-area for that case, as GCC does
that itself. "Our" store would be marked as redundant and GCC
will attempt to remove it, which will then be flagged as an
internal error; trying to remove a frame-related insn. */
- int stdarg_regs = cfun->machine->stdarg_regs;
+ int stdarg_regs = MACHINE_FUNCTION (*cfun)->stdarg_regs;
framesize += pretend;
@@ -3769,7 +3771,7 @@ cris_setup_incoming_varargs (CUMULATIVE_ARGS *ca,
if (ca->regs < CRIS_MAX_ARGS_IN_REGS)
{
int stdarg_regs = CRIS_MAX_ARGS_IN_REGS - ca->regs;
- cfun->machine->stdarg_regs = stdarg_regs;
+ MACHINE_FUNCTION (*cfun)->stdarg_regs = stdarg_regs;
*pretend_arg_size = stdarg_regs * 4;
}
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 305662303f8..4c4a3918f9d 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -1230,7 +1230,7 @@ frv_stack_info (void)
if (df_regs_ever_live_p (LR_REGNO)
|| profile_flag
/* This is set for __builtin_return_address, etc. */
- || cfun->machine->frame_needed
+ || MACHINE_FUNCTION (*cfun)->frame_needed
|| (TARGET_LINKED_FP && frame_pointer_needed)
|| (!TARGET_FDPIC && flag_pic
&& crtl->uses_pic_offset_table))
@@ -2163,7 +2163,7 @@ frv_frame_pointer_required (void)
if (profile_flag)
return true;
- if (cfun->machine->frame_needed)
+ if (MACHINE_FUNCTION (*cfun)->frame_needed)
return true;
return false;
@@ -2528,7 +2528,7 @@ frv_final_prescan_insn (rtx insn, rtx *opvec,
rtx
frv_dynamic_chain_address (rtx frame)
{
- cfun->machine->frame_needed = 1;
+ MACHINE_FUNCTION (*cfun)->frame_needed = 1;
return frame;
}
@@ -2548,7 +2548,7 @@ frv_return_addr_rtx (int count, rtx frame)
{
if (count != 0)
return const0_rtx;
- cfun->machine->frame_needed = 1;
+ MACHINE_FUNCTION (*cfun)->frame_needed = 1;
return gen_rtx_MEM (Pmode, plus_constant (frame, 8));
}
@@ -8255,7 +8255,8 @@ frv_register_nop (rtx nop)
static void
frv_reorg (void)
{
- if (optimize > 0 && TARGET_OPTIMIZE_MEMBAR && cfun->machine->has_membar_p)
+ if (optimize > 0 && TARGET_OPTIMIZE_MEMBAR
+ && MACHINE_FUNCTION (*cfun)->has_membar_p)
frv_optimize_membar ();
frv_num_nops = 0;
@@ -9181,7 +9182,7 @@ frv_expand_load_builtin (enum insn_code icode, enum machine_mode target_mode,
op0 = frv_volatile_memref (insn_data[icode].operand[0].mode, op0);
convert_move (target, op0, 1);
emit_insn (GEN_FCN (icode) (copy_rtx (op0), cookie, GEN_INT (FRV_IO_READ)));
- cfun->machine->has_membar_p = 1;
+ MACHINE_FUNCTION (*cfun)->has_membar_p = 1;
return target;
}
@@ -9197,7 +9198,7 @@ frv_expand_store_builtin (enum insn_code icode, tree call)
op0 = frv_volatile_memref (insn_data[icode].operand[0].mode, op0);
convert_move (op0, force_reg (insn_data[icode].operand[0].mode, op1), 1);
emit_insn (GEN_FCN (icode) (copy_rtx (op0), cookie, GEN_INT (FRV_IO_WRITE)));
- cfun->machine->has_membar_p = 1;
+ MACHINE_FUNCTION (*cfun)->has_membar_p = 1;
return NULL_RTX;
}
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index f2b70afa447..be7269f9c1a 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -34,7 +34,9 @@ along with GCC; see the file COPYING3. If not see
#endif
#undef TARGET_64BIT_MS_ABI
-#define TARGET_64BIT_MS_ABI (!cfun ? ix86_abi == MS_ABI : TARGET_64BIT && cfun->machine->call_abi == MS_ABI)
+#define TARGET_64BIT_MS_ABI \
+ (!cfun ? ix86_abi == MS_ABI \
+ : TARGET_64BIT && MACHINE_FUNCTION (*cfun)->call_abi == MS_ABI)
#undef DEFAULT_ABI
#define DEFAULT_ABI (TARGET_64BIT ? MS_ABI : SYSV_ABI)
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 1c4ac069ba6..d34618ff088 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -4507,7 +4507,7 @@ ix86_function_ok_for_sibcall (tree decl, tree exp)
{
/* The SYSV ABI has more call-clobbered registers;
disallow sibcalls from MS to SYSV. */
- if (cfun->machine->call_abi == MS_ABI
+ if (MACHINE_FUNCTION (*cfun)->call_abi == MS_ABI
&& ix86_function_type_abi (type) == SYSV_ABI)
return false;
}
@@ -5040,7 +5040,7 @@ ix86_cfun_abi (void)
{
if (! cfun || ! TARGET_64BIT)
return ix86_abi;
- return cfun->machine->call_abi;
+ return MACHINE_FUNCTION (*cfun)->call_abi;
}
/* regclass.c */
@@ -5053,9 +5053,10 @@ void
ix86_call_abi_override (const_tree fndecl)
{
if (fndecl == NULL_TREE)
- cfun->machine->call_abi = ix86_abi;
+ MACHINE_FUNCTION (*cfun)->call_abi = ix86_abi;
else
- cfun->machine->call_abi = ix86_function_type_abi (TREE_TYPE (fndecl));
+ MACHINE_FUNCTION (*cfun)->call_abi
+ = ix86_function_type_abi (TREE_TYPE (fndecl));
}
/* MS and SYSV ABI have different set of call used registers. Avoid expensive
@@ -5065,7 +5066,7 @@ static void
ix86_maybe_switch_abi (void)
{
if (TARGET_64BIT &&
- call_used_regs[SI_REG] == (cfun->machine->call_abi == MS_ABI))
+ call_used_regs[SI_REG] == (MACHINE_FUNCTION (*cfun)->call_abi == MS_ABI))
reinit_regs ();
}
@@ -7715,7 +7716,7 @@ ix86_frame_pointer_required (void)
{
/* If we accessed previous frames, then the generated code expects
to be able to access the saved ebp value in our frame. */
- if (cfun->machine->accesses_prev_frame)
+ if (MACHINE_FUNCTION (*cfun)->accesses_prev_frame)
return true;
/* Several x86 os'es need a frame pointer for other reasons,
@@ -7742,7 +7743,7 @@ ix86_frame_pointer_required (void)
void
ix86_setup_frame_addresses (void)
{
- cfun->machine->accesses_prev_frame = 1;
+ MACHINE_FUNCTION (*cfun)->accesses_prev_frame = 1;
}
#ifndef USE_HIDDEN_LINKONCE
@@ -8176,12 +8177,13 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
didn't change as reload does multiple calls to the function and does not
expect the decision to change within single iteration. */
if (!optimize_function_for_size_p (cfun)
- && cfun->machine->use_fast_prologue_epilogue_nregs != frame->nregs)
+ && (MACHINE_FUNCTION (*cfun)->use_fast_prologue_epilogue_nregs
+ != frame->nregs))
{
int count = frame->nregs;
struct cgraph_node *node = cgraph_node (current_function_decl);
- cfun->machine->use_fast_prologue_epilogue_nregs = count;
+ MACHINE_FUNCTION (*cfun)->use_fast_prologue_epilogue_nregs = count;
/* The fast prologue uses move instead of push to save registers. This
is significantly longer, but also executes faster as modern hardware
can execute the moves in parallel, but can't do that for push/pop.
@@ -8197,13 +8199,13 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
if (node->frequency < NODE_FREQUENCY_NORMAL
|| (flag_branch_probabilities
&& node->frequency < NODE_FREQUENCY_HOT))
- cfun->machine->use_fast_prologue_epilogue = false;
+ MACHINE_FUNCTION (*cfun)->use_fast_prologue_epilogue = false;
else
- cfun->machine->use_fast_prologue_epilogue
+ MACHINE_FUNCTION (*cfun)->use_fast_prologue_epilogue
= !expensive_function_p (count);
}
if (TARGET_PROLOGUE_USING_MOVE
- && cfun->machine->use_fast_prologue_epilogue)
+ && MACHINE_FUNCTION (*cfun)->use_fast_prologue_epilogue)
frame->save_regs_using_mov = true;
else
frame->save_regs_using_mov = false;
@@ -8834,7 +8836,7 @@ ix86_expand_prologue (void)
bool eax_live;
rtx t;
- if (cfun->machine->call_abi == MS_ABI)
+ if (MACHINE_FUNCTION (*cfun)->call_abi == MS_ABI)
eax_live = false;
else
eax_live = ix86_eax_live_at_start_p ();
@@ -9210,13 +9212,13 @@ ix86_expand_epilogue (int style)
tuning in future. */
if ((!sp_valid && (frame.nregs + frame.nsseregs) <= 1)
|| (TARGET_EPILOGUE_USING_MOVE
- && cfun->machine->use_fast_prologue_epilogue
+ && MACHINE_FUNCTION (*cfun)->use_fast_prologue_epilogue
&& ((frame.nregs + frame.nsseregs) > 1
|| (frame.to_allocate + frame.padding0) != 0))
|| (frame_pointer_needed && !(frame.nregs + frame.nsseregs)
&& (frame.to_allocate + frame.padding0) != 0)
|| (frame_pointer_needed && TARGET_USE_LEAVE
- && cfun->machine->use_fast_prologue_epilogue
+ && MACHINE_FUNCTION (*cfun)->use_fast_prologue_epilogue
&& (frame.nregs + frame.nsseregs) == 1)
|| crtl->calls_eh_return)
{
@@ -9328,7 +9330,7 @@ ix86_expand_epilogue (int style)
style, !using_drap);
/* If not an i386, mov & pop is faster than "leave". */
else if (TARGET_USE_LEAVE || optimize_function_for_size_p (cfun)
- || !cfun->machine->use_fast_prologue_epilogue)
+ || !MACHINE_FUNCTION (*cfun)->use_fast_prologue_epilogue)
ix86_emit_leave (red_offset);
else
{
@@ -11583,7 +11585,7 @@ get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
if (GET_CODE (x) == SYMBOL_REF
&& SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC)
{
- cfun->machine->some_ld_name = XSTR (x, 0);
+ MACHINE_FUNCTION (*cfun)->some_ld_name = XSTR (x, 0);
return 1;
}
@@ -11595,13 +11597,13 @@ get_some_local_dynamic_name (void)
{
rtx insn;
- if (cfun->machine->some_ld_name)
- return cfun->machine->some_ld_name;
+ if (MACHINE_FUNCTION (*cfun)->some_ld_name)
+ return MACHINE_FUNCTION (*cfun)->some_ld_name;
for (insn = get_insns (); insn ; insn = NEXT_INSN (insn))
if (NONDEBUG_INSN_P (insn)
&& for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0))
- return cfun->machine->some_ld_name;
+ return MACHINE_FUNCTION (*cfun)->some_ld_name;
return NULL;
}
@@ -26616,7 +26618,7 @@ x86_output_mi_thunk (FILE *file,
output_asm_insn ("jmp\t%P0", xops);
/* All thunks should be in the same object as their target,
and thus binds_local_p should be true. */
- else if (TARGET_64BIT && cfun->machine->call_abi == MS_ABI)
+ else if (TARGET_64BIT && MACHINE_FUNCTION (*cfun)->call_abi == MS_ABI)
gcc_unreachable ();
else
{
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 226f7849829..469eb57319b 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2384,13 +2384,14 @@ struct GTY(()) machine_function {
};
#endif
-#define ix86_stack_locals (cfun->machine->stack_locals)
-#define ix86_varargs_gpr_size (cfun->machine->varargs_gpr_size)
-#define ix86_varargs_fpr_size (cfun->machine->varargs_fpr_size)
-#define ix86_optimize_mode_switching (cfun->machine->optimize_mode_switching)
-#define ix86_current_function_needs_cld (cfun->machine->needs_cld)
+#define ix86_stack_locals (MACHINE_FUNCTION (*cfun)->stack_locals)
+#define ix86_varargs_gpr_size (MACHINE_FUNCTION (*cfun)->varargs_gpr_size)
+#define ix86_varargs_fpr_size (MACHINE_FUNCTION (*cfun)->varargs_fpr_size)
+#define ix86_optimize_mode_switching \
+ (MACHINE_FUNCTION (*cfun)->optimize_mode_switching)
+#define ix86_current_function_needs_cld (MACHINE_FUNCTION (*cfun)->needs_cld)
#define ix86_tls_descriptor_calls_expanded_in_cfun \
- (cfun->machine->tls_descriptor_call_expanded_p)
+ (MACHINE_FUNCTION (*cfun)->tls_descriptor_call_expanded_p)
/* Since tls_descriptor_call_expanded is not cleared, even if all TLS
calls are optimized away, we try to detect cases in which it was
optimized away. Since such instructions (use (reg REG_SP)), we can
@@ -2398,8 +2399,9 @@ struct GTY(()) machine_function {
REG_SP is live. */
#define ix86_current_function_calls_tls_descriptor \
(ix86_tls_descriptor_calls_expanded_in_cfun && df_regs_ever_live_p (SP_REG))
-#define ix86_cfa_state (&cfun->machine->cfa)
-#define ix86_static_chain_on_stack (cfun->machine->static_chain_on_stack)
+#define ix86_cfa_state (&MACHINE_FUNCTION (*cfun)->cfa)
+#define ix86_static_chain_on_stack \
+ (MACHINE_FUNCTION (*cfun)->static_chain_on_stack)
/* Control behavior of x86_file_start. */
#define X86_FILE_START_VERSION_DIRECTIVE false
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 3b93a9abc4c..37afee95641 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -2489,10 +2489,11 @@ ia64_compute_frame_size (HOST_WIDE_INT size)
diddle_return_value (mark_reg_gr_used_mask, NULL);
/* Don't allocate scratches to the EH scratch registers. */
- if (cfun->machine->ia64_eh_epilogue_sp)
- mark_reg_gr_used_mask (cfun->machine->ia64_eh_epilogue_sp, NULL);
- if (cfun->machine->ia64_eh_epilogue_bsp)
- mark_reg_gr_used_mask (cfun->machine->ia64_eh_epilogue_bsp, NULL);
+ if (MACHINE_FUNCTION (*cfun)->ia64_eh_epilogue_sp)
+ mark_reg_gr_used_mask (MACHINE_FUNCTION (*cfun)->ia64_eh_epilogue_sp, NULL);
+ if (MACHINE_FUNCTION (*cfun)->ia64_eh_epilogue_bsp)
+ mark_reg_gr_used_mask (MACHINE_FUNCTION (*cfun)->ia64_eh_epilogue_bsp,
+ NULL);
/* Find the size of the register stack frame. We have only 80 local
registers, because we reserve 8 for the inputs and 8 for the
@@ -2510,7 +2511,7 @@ ia64_compute_frame_size (HOST_WIDE_INT size)
all eight input registers as in use, so that locals aren't visible to
the caller. */
- if (cfun->machine->n_varargs > 0
+ if (MACHINE_FUNCTION (*cfun)->n_varargs > 0
|| lookup_attribute ("syscall_linkage",
TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
current_frame_info.n_input_regs = 8;
@@ -2698,7 +2699,7 @@ ia64_compute_frame_size (HOST_WIDE_INT size)
/* If we're forced to use st8.spill, we're forced to save and restore
ar.unat as well. The check for existing liveness allows inline asm
to touch ar.unat. */
- if (spilled_gr_p || cfun->machine->n_varargs
+ if (spilled_gr_p || MACHINE_FUNCTION (*cfun)->n_varargs
|| df_regs_ever_live_p (AR_UNAT_REGNUM))
{
df_set_regs_ever_live (AR_UNAT_REGNUM, true);
@@ -3184,7 +3185,7 @@ ia64_expand_prologue (void)
/* Set up frame pointer, stack pointer, and spill iterators. */
- n_varargs = cfun->machine->n_varargs;
+ n_varargs = MACHINE_FUNCTION (*cfun)->n_varargs;
setup_spill_pointers (current_frame_info.n_spilled + n_varargs,
stack_pointer_rtx, 0);
@@ -3611,7 +3612,7 @@ ia64_expand_epilogue (int sibcall_p)
finish_spill_pointers ();
if (current_frame_info.total_size
- || cfun->machine->ia64_eh_epilogue_sp
+ || MACHINE_FUNCTION (*cfun)->ia64_eh_epilogue_sp
|| frame_pointer_needed)
{
/* ??? At this point we must generate a magic insn that appears to
@@ -3621,8 +3622,9 @@ ia64_expand_epilogue (int sibcall_p)
emit_insn (gen_blockage ());
}
- if (cfun->machine->ia64_eh_epilogue_sp)
- emit_move_insn (stack_pointer_rtx, cfun->machine->ia64_eh_epilogue_sp);
+ if (MACHINE_FUNCTION (*cfun)->ia64_eh_epilogue_sp)
+ emit_move_insn (stack_pointer_rtx,
+ MACHINE_FUNCTION (*cfun)->ia64_eh_epilogue_sp);
else if (frame_pointer_needed)
{
insn = emit_move_insn (stack_pointer_rtx, hard_frame_pointer_rtx);
@@ -3655,8 +3657,8 @@ ia64_expand_epilogue (int sibcall_p)
frame_size_rtx)));
}
- if (cfun->machine->ia64_eh_epilogue_bsp)
- emit_insn (gen_set_bsp (cfun->machine->ia64_eh_epilogue_bsp));
+ if (MACHINE_FUNCTION (*cfun)->ia64_eh_epilogue_bsp)
+ emit_insn (gen_set_bsp (MACHINE_FUNCTION (*cfun)->ia64_eh_epilogue_bsp));
if (! sibcall_p)
emit_jump_insn (gen_return_internal (gen_rtx_REG (DImode, BR_REG (0))));
@@ -4064,7 +4066,7 @@ ia64_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
{
int n = MAX_ARGUMENT_SLOTS - next_cum.words;
*pretend_size = n * UNITS_PER_WORD;
- cfun->machine->n_varargs = n;
+ MACHINE_FUNCTION (*cfun)->n_varargs = n;
}
}
@@ -9533,7 +9535,7 @@ process_epilogue (FILE *asm_out_file, rtx insn, bool unwind, bool frame)
{
if (unwind)
fprintf (asm_out_file, "\t.label_state %d\n",
- ++cfun->machine->state_num);
+ ++MACHINE_FUNCTION (*cfun)->state_num);
need_copy_state = true;
}
@@ -9803,7 +9805,7 @@ process_for_unwind_directive (FILE *asm_out_file, rtx insn)
{
fprintf (asm_out_file, "\t.body\n");
fprintf (asm_out_file, "\t.copy_state %d\n",
- cfun->machine->state_num);
+ MACHINE_FUNCTION (*cfun)->state_num);
}
if (IA64_CHANGE_CFA_IN_EPILOGUE)
ia64_dwarf2out_def_steady_cfa (insn, frame);
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md
index 26c88472650..3b982d0b2a1 100644
--- a/gcc/config/ia64/ia64.md
+++ b/gcc/config/ia64/ia64.md
@@ -5079,8 +5079,8 @@
emit_use (sp);
emit_use (bsp);
- cfun->machine->ia64_eh_epilogue_sp = sp;
- cfun->machine->ia64_eh_epilogue_bsp = bsp;
+ MACHINE_FUNCTION (*cfun)->ia64_eh_epilogue_sp = sp;
+ MACHINE_FUNCTION (*cfun)->ia64_eh_epilogue_bsp = bsp;
})
;; Builtin apply support.
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 2175c193b88..08ac2faa955 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -1480,9 +1480,9 @@ iq2000_debugger_offset (rtx addr, HOST_WIDE_INT offset)
if (reg == stack_pointer_rtx || reg == frame_pointer_rtx
|| reg == hard_frame_pointer_rtx)
{
- HOST_WIDE_INT frame_size = (!cfun->machine->initialized)
+ HOST_WIDE_INT frame_size = (!MACHINE_FUNCTION (*cfun)->initialized)
? compute_frame_size (get_frame_size ())
- : cfun->machine->total_size;
+ : MACHINE_FUNCTION (*cfun)->total_size;
offset = offset - frame_size;
}
@@ -1667,15 +1667,15 @@ compute_frame_size (HOST_WIDE_INT size)
total_size += IQ2000_STACK_ALIGN (crtl->args.pretend_args_size);
/* Save other computed information. */
- cfun->machine->total_size = total_size;
- cfun->machine->var_size = var_size;
- cfun->machine->args_size = args_size;
- cfun->machine->extra_size = extra_size;
- cfun->machine->gp_reg_size = gp_reg_size;
- cfun->machine->fp_reg_size = fp_reg_size;
- cfun->machine->mask = mask;
- cfun->machine->initialized = reload_completed;
- cfun->machine->num_gp = gp_reg_size / UNITS_PER_WORD;
+ MACHINE_FUNCTION (*cfun)->total_size = total_size;
+ MACHINE_FUNCTION (*cfun)->var_size = var_size;
+ MACHINE_FUNCTION (*cfun)->args_size = args_size;
+ MACHINE_FUNCTION (*cfun)->extra_size = extra_size;
+ MACHINE_FUNCTION (*cfun)->gp_reg_size = gp_reg_size;
+ MACHINE_FUNCTION (*cfun)->fp_reg_size = fp_reg_size;
+ MACHINE_FUNCTION (*cfun)->mask = mask;
+ MACHINE_FUNCTION (*cfun)->initialized = reload_completed;
+ MACHINE_FUNCTION (*cfun)->num_gp = gp_reg_size / UNITS_PER_WORD;
if (mask)
{
@@ -1684,17 +1684,17 @@ compute_frame_size (HOST_WIDE_INT size)
offset = (args_size + extra_size + var_size
+ gp_reg_size - GET_MODE_SIZE (gpr_mode));
- cfun->machine->gp_sp_offset = offset;
- cfun->machine->gp_save_offset = offset - total_size;
+ MACHINE_FUNCTION (*cfun)->gp_sp_offset = offset;
+ MACHINE_FUNCTION (*cfun)->gp_save_offset = offset - total_size;
}
else
{
- cfun->machine->gp_sp_offset = 0;
- cfun->machine->gp_save_offset = 0;
+ MACHINE_FUNCTION (*cfun)->gp_sp_offset = 0;
+ MACHINE_FUNCTION (*cfun)->gp_save_offset = 0;
}
- cfun->machine->fp_sp_offset = 0;
- cfun->machine->fp_save_offset = 0;
+ MACHINE_FUNCTION (*cfun)->fp_sp_offset = 0;
+ MACHINE_FUNCTION (*cfun)->fp_save_offset = 0;
/* Ok, we're done. */
return total_size;
@@ -1729,12 +1729,12 @@ iq2000_initial_elimination_offset (int from, int to ATTRIBUTE_UNUSED)
if ((from) == FRAME_POINTER_REGNUM)
(offset) = 0;
else if ((from) == ARG_POINTER_REGNUM)
- (offset) = (cfun->machine->total_size);
+ (offset) = (MACHINE_FUNCTION (*cfun)->total_size);
else if ((from) == RETURN_ADDRESS_POINTER_REGNUM)
{
if (leaf_function_p ())
(offset) = 0;
- else (offset) = cfun->machine->gp_sp_offset
+ else (offset) = MACHINE_FUNCTION (*cfun)->gp_sp_offset
+ ((UNITS_PER_WORD - (POINTER_SIZE / BITS_PER_UNIT))
* (BYTES_BIG_ENDIAN != 0));
}
@@ -1798,7 +1798,7 @@ iq2000_emit_frame_related_store (rtx mem, rtx reg, HOST_WIDE_INT offset)
static void
save_restore_insns (int store_p)
{
- long mask = cfun->machine->mask;
+ long mask = MACHINE_FUNCTION (*cfun)->mask;
int regno;
rtx base_reg_rtx;
HOST_WIDE_INT base_offset;
@@ -1826,9 +1826,9 @@ save_restore_insns (int store_p)
the constant created in the prologue/epilogue to adjust the stack
frame. */
- gp_offset = cfun->machine->gp_sp_offset;
+ gp_offset = MACHINE_FUNCTION (*cfun)->gp_sp_offset;
end_offset
- = gp_offset - (cfun->machine->gp_reg_size
+ = gp_offset - (MACHINE_FUNCTION (*cfun)->gp_reg_size
- GET_MODE_SIZE (gpr_mode));
if (gp_offset < 0 || end_offset < 0)
@@ -2057,7 +2057,7 @@ iq2000_expand_prologue (void)
void
iq2000_expand_epilogue (void)
{
- HOST_WIDE_INT tsize = cfun->machine->total_size;
+ HOST_WIDE_INT tsize = MACHINE_FUNCTION (*cfun)->total_size;
rtx tsize_rtx = GEN_INT (tsize);
rtx tmp_rtx = (rtx)0;
@@ -2117,7 +2117,7 @@ iq2000_expand_epilogue (void)
void
iq2000_expand_eh_return (rtx address)
{
- HOST_WIDE_INT gp_offset = cfun->machine->gp_sp_offset;
+ HOST_WIDE_INT gp_offset = MACHINE_FUNCTION (*cfun)->gp_sp_offset;
rtx scratch;
scratch = plus_constant (stack_pointer_rtx, gp_offset);
@@ -2137,8 +2137,8 @@ iq2000_can_use_return_insn (void)
if (df_regs_ever_live_p (31) || profile_flag)
return 0;
- if (cfun->machine->initialized)
- return cfun->machine->total_size == 0;
+ if (MACHINE_FUNCTION (*cfun)->initialized)
+ return MACHINE_FUNCTION (*cfun)->total_size == 0;
return compute_frame_size (get_frame_size ()) == 0;
}
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 3280d14e78e..57fab075348 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -1154,14 +1154,14 @@ m32c_eh_return_data_regno (int n)
rtx
m32c_eh_return_stackadj_rtx (void)
{
- if (!cfun->machine->eh_stack_adjust)
+ if (!MACHINE_FUNCTION (*cfun)->eh_stack_adjust)
{
rtx sa;
sa = gen_rtx_REG (Pmode, R0_REGNO);
- cfun->machine->eh_stack_adjust = sa;
+ MACHINE_FUNCTION (*cfun)->eh_stack_adjust = sa;
}
- return cfun->machine->eh_stack_adjust;
+ return MACHINE_FUNCTION (*cfun)->eh_stack_adjust;
}
/* Registers That Address the Stack Frame */
@@ -1261,14 +1261,14 @@ need_to_save (int regno)
return 1;
if (regno == FP_REGNO)
return 0;
- if (cfun->machine->is_interrupt
- && (!cfun->machine->is_leaf
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt
+ && (!MACHINE_FUNCTION (*cfun)->is_leaf
|| (regno == A0_REGNO
&& m32c_function_needs_enter ())
))
return 1;
if (df_regs_ever_live_p (regno)
- && (!call_used_regs[regno] || cfun->machine->is_interrupt))
+ && (!call_used_regs[regno] || MACHINE_FUNCTION (*cfun)->is_interrupt))
return 1;
return 0;
}
@@ -1292,7 +1292,7 @@ m32c_pushm_popm (Push_Pop_Type ppt)
if (crtl->return_rtx
&& GET_CODE (crtl->return_rtx) == PARALLEL
- && !(crtl->calls_eh_return || cfun->machine->is_interrupt))
+ && !(crtl->calls_eh_return || MACHINE_FUNCTION (*cfun)->is_interrupt))
{
rtx exp = XVECEXP (crtl->return_rtx, 0, 0);
rtx rv = XEXP (exp, 0);
@@ -1342,19 +1342,19 @@ m32c_pushm_popm (Push_Pop_Type ppt)
byte_count += bytes;
}
- if (cfun->machine->is_interrupt)
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt)
{
- cfun->machine->intr_pushm = reg_mask & 0xfe;
+ MACHINE_FUNCTION (*cfun)->intr_pushm = reg_mask & 0xfe;
reg_mask = 0;
byte_count = 0;
}
- if (cfun->machine->is_interrupt)
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt)
for (i = MEM0_REGNO; i <= MEM7_REGNO; i++)
if (need_to_save (i))
{
byte_count += 2;
- cfun->machine->intr_pushmem[i - MEM0_REGNO] = 1;
+ MACHINE_FUNCTION (*cfun)->intr_pushmem[i - MEM0_REGNO] = 1;
}
if (ppt == PP_pushm && byte_count)
@@ -1381,9 +1381,9 @@ m32c_pushm_popm (Push_Pop_Type ppt)
REG_NOTES (pushm));
}
- if (cfun->machine->is_interrupt)
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt)
for (i = MEM0_REGNO; i <= MEM7_REGNO; i++)
- if (cfun->machine->intr_pushmem[i - MEM0_REGNO])
+ if (MACHINE_FUNCTION (*cfun)->intr_pushmem[i - MEM0_REGNO])
{
if (TARGET_A16)
pushm = emit_insn (gen_pushhi_16 (gen_rtx_REG (HImode, i)));
@@ -1394,9 +1394,9 @@ m32c_pushm_popm (Push_Pop_Type ppt)
}
if (ppt == PP_popm && byte_count)
{
- if (cfun->machine->is_interrupt)
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt)
for (i = MEM7_REGNO; i >= MEM0_REGNO; i--)
- if (cfun->machine->intr_pushmem[i - MEM0_REGNO])
+ if (MACHINE_FUNCTION (*cfun)->intr_pushmem[i - MEM0_REGNO])
{
if (TARGET_A16)
emit_insn (gen_pophi_16 (gen_rtx_REG (HImode, i)));
@@ -1694,7 +1694,7 @@ m32c_struct_value_rtx (tree fndecl ATTRIBUTE_UNUSED,
int
m32c_epilogue_uses (int regno ATTRIBUTE_UNUSED)
{
- if (cfun->machine->is_interrupt)
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt)
return 1;
return 0;
}
@@ -3985,10 +3985,10 @@ m32c_emit_prologue (void)
int frame_size, extra_frame_size = 0, reg_save_size;
int complex_prologue = 0;
- cfun->machine->is_leaf = m32c_leaf_function_p ();
+ MACHINE_FUNCTION (*cfun)->is_leaf = m32c_leaf_function_p ();
if (interrupt_p (cfun->decl))
{
- cfun->machine->is_interrupt = 1;
+ MACHINE_FUNCTION (*cfun)->is_interrupt = 1;
complex_prologue = 1;
}
else if (bank_switch_p (cfun->decl))
@@ -4001,22 +4001,22 @@ m32c_emit_prologue (void)
{
if (bank_switch_p (cfun->decl))
emit_insn (gen_fset_b ());
- else if (cfun->machine->intr_pushm)
- emit_insn (gen_pushm (GEN_INT (cfun->machine->intr_pushm)));
+ else if (MACHINE_FUNCTION (*cfun)->intr_pushm)
+ emit_insn (gen_pushm (GEN_INT (MACHINE_FUNCTION (*cfun)->intr_pushm)));
}
frame_size =
m32c_initial_elimination_offset (FB_REGNO, SP_REGNO) - reg_save_size;
if (frame_size == 0
&& !m32c_function_needs_enter ())
- cfun->machine->use_rts = 1;
+ MACHINE_FUNCTION (*cfun)->use_rts = 1;
if (frame_size > 254)
{
extra_frame_size = frame_size - 254;
frame_size = 254;
}
- if (cfun->machine->use_rts == 0)
+ if (MACHINE_FUNCTION (*cfun)->use_rts == 0)
F (emit_insn (m32c_all_frame_related
(TARGET_A16
? gen_prologue_enter_16 (GEN_INT (frame_size + 2))
@@ -4049,19 +4049,20 @@ void
m32c_emit_epilogue (void)
{
/* This just emits a comment into the .s file for debugging. */
- if (m32c_pushm_popm (PP_justcount) > 0 || cfun->machine->is_interrupt)
+ if (m32c_pushm_popm (PP_justcount) > 0
+ || MACHINE_FUNCTION (*cfun)->is_interrupt)
emit_insn (gen_epilogue_start ());
m32c_pushm_popm (PP_popm);
- if (cfun->machine->is_interrupt)
+ if (MACHINE_FUNCTION (*cfun)->is_interrupt)
{
enum machine_mode spmode = TARGET_A16 ? HImode : PSImode;
/* REIT clears B flag and restores $fp for us, but we still
have to fix up the stack. USE_RTS just means we didn't
emit ENTER. */
- if (!cfun->machine->use_rts)
+ if (!MACHINE_FUNCTION (*cfun)->use_rts)
{
emit_move_insn (gen_rtx_REG (spmode, A0_REGNO),
gen_rtx_REG (spmode, FP_REGNO));
@@ -4075,8 +4076,8 @@ m32c_emit_epilogue (void)
else
emit_insn (gen_poppsi (gen_rtx_REG (PSImode, FP_REGNO)));
}
- if (!bank_switch_p (cfun->decl) && cfun->machine->intr_pushm)
- emit_insn (gen_popm (GEN_INT (cfun->machine->intr_pushm)));
+ if (!bank_switch_p (cfun->decl) && MACHINE_FUNCTION (*cfun)->intr_pushm)
+ emit_insn (gen_popm (GEN_INT (MACHINE_FUNCTION (*cfun)->intr_pushm)));
/* The FREIT (Fast REturn from InTerrupt) instruction should be
generated only for M32C/M32CM targets (generate the REIT
@@ -4103,7 +4104,7 @@ m32c_emit_epilogue (void)
else
emit_jump_insn (gen_epilogue_reit_24 ());
}
- else if (cfun->machine->use_rts)
+ else if (MACHINE_FUNCTION (*cfun)->use_rts)
emit_jump_insn (gen_epilogue_rts ());
else if (TARGET_A16)
emit_jump_insn (gen_epilogue_exitd_16 ());
@@ -4119,7 +4120,8 @@ m32c_emit_eh_epilogue (rtx ret_addr)
return to. We have to fudge the stack, pop everything, pop SP
(fudged), and return (fudged). This is actually easier to do in
assembler, so punt to libgcc. */
- emit_jump_insn (gen_eh_epilogue (ret_addr, cfun->machine->eh_stack_adjust));
+ emit_jump_insn (gen_eh_epilogue (ret_addr,
+ MACHINE_FUNCTION (*cfun)->eh_stack_adjust));
/* emit_clobber (gen_rtx_REG (HImode, R0L_REGNO)); */
emit_barrier ();
}
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index 9e23e45f8bb..acfc6a8b644 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -1477,7 +1477,7 @@ mep_expand_mov (rtx *operands, enum machine_mode mode)
rtx r;
if (GET_CODE (operands[0]) == REG && REGNO (operands[0]) == TP_REGNO)
- cfun->machine->reload_changes_tp = true;
+ MACHINE_FUNCTION (*cfun)->reload_changes_tp = true;
if (tag[0] == 't' || tag[1] == 't')
{
@@ -1491,7 +1491,7 @@ mep_expand_mov (rtx *operands, enum machine_mode mode)
if (!r || GET_CODE (r) != REG || REGNO (r) != TP_REGNO)
post_reload = 1;
}
- if (cfun->machine->reload_changes_tp == true)
+ if (MACHINE_FUNCTION (*cfun)->reload_changes_tp == true)
post_reload = 1;
}
@@ -2390,13 +2390,14 @@ mep_allocate_initial_value (rtx reg)
if (mep_interrupt_p ())
return NULL_RTX;
- if (! cfun->machine->reg_save_slot[REGNO(reg)])
+ if (! MACHINE_FUNCTION (*cfun)->reg_save_slot[REGNO(reg)])
{
- cfun->machine->reg_save_size += 4;
- cfun->machine->reg_save_slot[REGNO(reg)] = cfun->machine->reg_save_size;
+ MACHINE_FUNCTION (*cfun)->reg_save_size += 4;
+ MACHINE_FUNCTION (*cfun)->reg_save_slot[REGNO(reg)]
+ = MACHINE_FUNCTION (*cfun)->reg_save_size;
}
- rss = cfun->machine->reg_save_slot[REGNO(reg)];
+ rss = MACHINE_FUNCTION (*cfun)->reg_save_slot[REGNO(reg)];
return gen_rtx_MEM (SImode, plus_constant (arg_pointer_rtx, -rss));
}
@@ -2424,29 +2425,29 @@ mep_gp_rtx (void)
static bool
mep_interrupt_p (void)
{
- if (cfun->machine->interrupt_handler == 0)
+ if (MACHINE_FUNCTION (*cfun)->interrupt_handler == 0)
{
int interrupt_handler
= (lookup_attribute ("interrupt",
DECL_ATTRIBUTES (current_function_decl))
!= NULL_TREE);
- cfun->machine->interrupt_handler = interrupt_handler ? 2 : 1;
+ MACHINE_FUNCTION (*cfun)->interrupt_handler = interrupt_handler ? 2 : 1;
}
- return cfun->machine->interrupt_handler == 2;
+ return MACHINE_FUNCTION (*cfun)->interrupt_handler == 2;
}
static bool
mep_disinterrupt_p (void)
{
- if (cfun->machine->disable_interrupts == 0)
+ if (MACHINE_FUNCTION (*cfun)->disable_interrupts == 0)
{
int disable_interrupts
= (lookup_attribute ("disinterrupt",
DECL_ATTRIBUTES (current_function_decl))
!= NULL_TREE);
- cfun->machine->disable_interrupts = disable_interrupts ? 2 : 1;
+ MACHINE_FUNCTION (*cfun)->disable_interrupts = disable_interrupts ? 2 : 1;
}
- return cfun->machine->disable_interrupts == 2;
+ return MACHINE_FUNCTION (*cfun)->disable_interrupts == 2;
}
@@ -2507,7 +2508,7 @@ mep_reg_set_in_function (int regno)
static bool
mep_asm_without_operands_p (void)
{
- if (cfun->machine->asms_without_operands == 0)
+ if (MACHINE_FUNCTION (*cfun)->asms_without_operands == 0)
{
rtx insn;
@@ -2515,20 +2516,20 @@ mep_asm_without_operands_p (void)
insn = get_insns ();
pop_topmost_sequence ();
- cfun->machine->asms_without_operands = 1;
+ MACHINE_FUNCTION (*cfun)->asms_without_operands = 1;
while (insn)
{
if (INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == ASM_INPUT)
{
- cfun->machine->asms_without_operands = 2;
+ MACHINE_FUNCTION (*cfun)->asms_without_operands = 2;
break;
}
insn = NEXT_INSN (insn);
}
}
- return cfun->machine->asms_without_operands == 2;
+ return MACHINE_FUNCTION (*cfun)->asms_without_operands == 2;
}
/* Interrupt functions save/restore every call-preserved register, and
@@ -2558,7 +2559,7 @@ mep_interrupt_saved_reg (int r)
/* Function calls mean we need to save $lp. */
if (r == LP_REGNO || IVC2_ISAVED_REG (r))
return true;
- if (!current_function_is_leaf || cfun->machine->doloop_tags > 0)
+ if (!current_function_is_leaf || MACHINE_FUNCTION (*cfun)->doloop_tags > 0)
/* The interrupt handler might use these registers for repeat blocks,
or it might call a function that does so. */
if (r == RPB_REGNO || r == RPE_REGNO || r == RPC_REGNO)
@@ -2578,11 +2579,11 @@ mep_interrupt_saved_reg (int r)
static bool
mep_call_saves_register (int r)
{
- if (! cfun->machine->frame_locked)
+ if (! MACHINE_FUNCTION (*cfun)->frame_locked)
{
int rv = MEP_SAVES_NO;
- if (cfun->machine->reg_save_slot[r])
+ if (MACHINE_FUNCTION (*cfun)->reg_save_slot[r])
rv = MEP_SAVES_YES;
else if (r == LP_REGNO && (profile_arc_flag > 0 || profile_flag > 0))
rv = MEP_SAVES_YES;
@@ -2596,9 +2597,9 @@ mep_call_saves_register (int r)
rv = MEP_SAVES_YES;
else if (mep_interrupt_saved_reg (r))
rv = MEP_SAVES_YES;
- cfun->machine->reg_saved[r] = rv;
+ MACHINE_FUNCTION (*cfun)->reg_saved[r] = rv;
}
- return cfun->machine->reg_saved[r] == MEP_SAVES_YES;
+ return MACHINE_FUNCTION (*cfun)->reg_saved[r] == MEP_SAVES_YES;
}
/* Return true if epilogue uses register REGNO. */
@@ -2643,8 +2644,9 @@ mep_elimination_offset (int from, int to)
int frame_size = get_frame_size () + crtl->outgoing_args_size;
int total_size;
- if (!cfun->machine->frame_locked)
- memset (cfun->machine->reg_saved, 0, sizeof (cfun->machine->reg_saved));
+ if (!MACHINE_FUNCTION (*cfun)->frame_locked)
+ memset (MACHINE_FUNCTION (*cfun)->reg_saved, 0,
+ sizeof (MACHINE_FUNCTION (*cfun)->reg_saved));
/* We don't count arg_regs_to_save in the arg pointer offset, because
gcc thinks the arg pointer has moved along with the saved regs.
@@ -2655,27 +2657,29 @@ mep_elimination_offset (int from, int to)
reg_save_size += mep_reg_size (i);
if (reg_save_size % 8)
- cfun->machine->regsave_filler = 8 - (reg_save_size % 8);
+ MACHINE_FUNCTION (*cfun)->regsave_filler = 8 - (reg_save_size % 8);
else
- cfun->machine->regsave_filler = 0;
+ MACHINE_FUNCTION (*cfun)->regsave_filler = 0;
/* This is what our total stack adjustment looks like. */
- total_size = (reg_save_size + frame_size + cfun->machine->regsave_filler);
+ total_size = (reg_save_size + frame_size
+ + MACHINE_FUNCTION (*cfun)->regsave_filler);
if (total_size % 8)
- cfun->machine->frame_filler = 8 - (total_size % 8);
+ MACHINE_FUNCTION (*cfun)->frame_filler = 8 - (total_size % 8);
else
- cfun->machine->frame_filler = 0;
+ MACHINE_FUNCTION (*cfun)->frame_filler = 0;
if (from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM)
- return reg_save_size + cfun->machine->regsave_filler;
+ return reg_save_size + MACHINE_FUNCTION (*cfun)->regsave_filler;
if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
- return cfun->machine->frame_filler + frame_size;
+ return MACHINE_FUNCTION (*cfun)->frame_filler + frame_size;
if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
- return reg_save_size + cfun->machine->regsave_filler + cfun->machine->frame_filler + frame_size;
+ return (reg_save_size + MACHINE_FUNCTION (*cfun)->regsave_filler
+ + MACHINE_FUNCTION (*cfun)->frame_filler + frame_size);
gcc_unreachable ();
}
@@ -2803,21 +2807,23 @@ mep_assign_save_slots (int reg_save_size)
|| mep_reg_set_in_function (i))
really_need_stack_frame = true;
- if (cfun->machine->reg_save_slot[i])
+ if (MACHINE_FUNCTION (*cfun)->reg_save_slot[i])
continue;
if (regsize < 8)
{
- cfun->machine->reg_save_size += regsize;
- cfun->machine->reg_save_slot[i] = cfun->machine->reg_save_size;
+ MACHINE_FUNCTION (*cfun)->reg_save_size += regsize;
+ MACHINE_FUNCTION (*cfun)->reg_save_slot[i]
+ = MACHINE_FUNCTION (*cfun)->reg_save_size;
}
else
{
- cfun->machine->reg_save_slot[i] = reg_save_size - di_ofs;
+ MACHINE_FUNCTION (*cfun)->reg_save_slot[i]
+ = reg_save_size - di_ofs;
di_ofs += 8;
}
}
- cfun->machine->frame_locked = 1;
+ MACHINE_FUNCTION (*cfun)->frame_locked = 1;
return really_need_stack_frame;
}
@@ -2837,7 +2843,7 @@ mep_expand_prologue (void)
if (mep_disinterrupt_p ())
emit_insn (gen_mep_disable_int ());
- cfun->machine->mep_frame_pointer_needed = frame_pointer_needed;
+ MACHINE_FUNCTION (*cfun)->mep_frame_pointer_needed = frame_pointer_needed;
reg_save_size = mep_elimination_offset (ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM);
frame_size = mep_elimination_offset (FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM);
@@ -2858,7 +2864,7 @@ mep_expand_prologue (void)
bool maybe_dead_p;
enum machine_mode rmode;
- rss = cfun->machine->reg_save_slot[i];
+ rss = MACHINE_FUNCTION (*cfun)->reg_save_slot[i];
if ((i == TP_REGNO || i == GP_REGNO || i == LP_REGNO)
&& (!mep_reg_set_in_function (i)
@@ -2962,9 +2968,9 @@ mep_start_function (FILE *file, HOST_WIDE_INT hwi_local)
frame_size = mep_elimination_offset (FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM);
sp_offset = reg_save_size + frame_size;
- ffill = cfun->machine->frame_filler;
+ ffill = MACHINE_FUNCTION (*cfun)->frame_filler;
- if (cfun->machine->mep_frame_pointer_needed)
+ if (MACHINE_FUNCTION (*cfun)->mep_frame_pointer_needed)
reg_names[FP_REGNO] = "$fp";
else
reg_names[FP_REGNO] = "$8";
@@ -2996,8 +3002,8 @@ mep_start_function (FILE *file, HOST_WIDE_INT hwi_local)
slot_map[si] = si;
for (si=0; si<FIRST_PSEUDO_REGISTER-1; si++)
for (sj=si+1; sj<FIRST_PSEUDO_REGISTER; sj++)
- if (cfun->machine->reg_save_slot[slot_map[si]]
- > cfun->machine->reg_save_slot[slot_map[sj]])
+ if (MACHINE_FUNCTION (*cfun)->reg_save_slot[slot_map[si]]
+ > MACHINE_FUNCTION (*cfun)->reg_save_slot[slot_map[sj]])
{
int t = slot_map[si];
slot_map[si] = slot_map[sj];
@@ -3009,7 +3015,7 @@ mep_start_function (FILE *file, HOST_WIDE_INT hwi_local)
{
int rsize;
int r = slot_map[i];
- int rss = cfun->machine->reg_save_slot[r];
+ int rss = MACHINE_FUNCTION (*cfun)->reg_save_slot[r];
if (!mep_call_saves_register (r))
continue;
@@ -3094,7 +3100,7 @@ mep_expand_epilogue (void)
if (mep_call_saves_register (i))
{
enum machine_mode rmode;
- int rss = cfun->machine->reg_save_slot[i];
+ int rss = MACHINE_FUNCTION (*cfun)->reg_save_slot[i];
if (mep_reg_size (i) == 8)
rmode = DImode;
@@ -3151,7 +3157,7 @@ mep_expand_epilogue (void)
if (crtl->calls_eh_return && mep_prevent_lp_restore)
emit_insn (gen_addsi3 (gen_rtx_REG (SImode, SP_REGNO),
gen_rtx_REG (SImode, SP_REGNO),
- cfun->machine->eh_stack_adjust));
+ MACHINE_FUNCTION (*cfun)->eh_stack_adjust));
if (mep_sibcall_epilogue)
return;
@@ -3186,7 +3192,7 @@ mep_expand_eh_return (rtx *operands)
void
mep_emit_eh_epilogue (rtx *operands ATTRIBUTE_UNUSED)
{
- cfun->machine->eh_stack_adjust = gen_rtx_REG (Pmode, 0);
+ MACHINE_FUNCTION (*cfun)->eh_stack_adjust = gen_rtx_REG (Pmode, 0);
mep_prevent_lp_restore = 1;
mep_expand_epilogue ();
mep_prevent_lp_restore = 0;
@@ -3533,7 +3539,7 @@ mep_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
int nsave = 4 - (cum->nregs + 1);
if (nsave > 0)
- cfun->machine->arg_regs_to_save = nsave;
+ MACHINE_FUNCTION (*cfun)->arg_regs_to_save = nsave;
*pretend_size = nsave * 4;
}
@@ -3551,7 +3557,7 @@ mep_expand_builtin_saveregs (void)
int bufsize, i, ns;
rtx regbuf;
- ns = cfun->machine->arg_regs_to_save;
+ ns = MACHINE_FUNCTION (*cfun)->arg_regs_to_save;
if (TARGET_IVC2)
{
bufsize = 8 * ((ns + 1) / 2) + 8 * ns;
@@ -3627,7 +3633,7 @@ mep_expand_va_start (tree valist, rtx nextarg)
tree t, u;
int ns;
- ns = cfun->machine->arg_regs_to_save;
+ ns = MACHINE_FUNCTION (*cfun)->arg_regs_to_save;
f_next_gp = TYPE_FIELDS (va_list_type_node);
f_next_gp_limit = TREE_CHAIN (f_next_gp);
@@ -5216,14 +5222,14 @@ mep_emit_doloop (rtx *operands, int is_end)
{
rtx tag;
- if (cfun->machine->doloop_tags == 0
- || cfun->machine->doloop_tag_from_end == is_end)
+ if (MACHINE_FUNCTION (*cfun)->doloop_tags == 0
+ || MACHINE_FUNCTION (*cfun)->doloop_tag_from_end == is_end)
{
- cfun->machine->doloop_tags++;
- cfun->machine->doloop_tag_from_end = is_end;
+ MACHINE_FUNCTION (*cfun)->doloop_tags++;
+ MACHINE_FUNCTION (*cfun)->doloop_tag_from_end = is_end;
}
- tag = GEN_INT (cfun->machine->doloop_tags - 1);
+ tag = GEN_INT (MACHINE_FUNCTION (*cfun)->doloop_tags - 1);
if (is_end)
emit_jump_insn (gen_doloop_end_internal (operands[0], operands[4], tag));
else
@@ -5403,12 +5409,14 @@ mep_reorg_repeat (rtx insns)
struct mep_doloop_end *end;
/* Quick exit if we haven't created any loops. */
- if (cfun->machine->doloop_tags == 0)
+ if (MACHINE_FUNCTION (*cfun)->doloop_tags == 0)
return;
/* Create an array of mep_doloop structures. */
- loops = (struct mep_doloop *) alloca (sizeof (loops[0]) * cfun->machine->doloop_tags);
- memset (loops, 0, sizeof (loops[0]) * cfun->machine->doloop_tags);
+ loops
+ = (struct mep_doloop *) alloca (sizeof (loops[0])
+ * MACHINE_FUNCTION (*cfun)->doloop_tags);
+ memset (loops, 0, sizeof (loops[0]) * MACHINE_FUNCTION (*cfun)->doloop_tags);
/* Search the function for do-while insns and group them by loop tag. */
for (insn = insns; insn; insn = NEXT_INSN (insn))
@@ -5454,7 +5462,8 @@ mep_reorg_repeat (rtx insns)
}
/* Convert the insns for each loop in turn. */
- for (loop = loops; loop < loops + cfun->machine->doloop_tags; loop++)
+ for (loop = loops; loop < loops + MACHINE_FUNCTION (*cfun)->doloop_tags;
+ loop++)
if (mep_repeat_loop_p (loop))
{
/* Case (1) or (2). */
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index b9b7cac303b..51971b850be 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -2622,13 +2622,13 @@ gen_load_const_gp (rtx reg)
static rtx
mips16_gp_pseudo_reg (void)
{
- if (cfun->machine->mips16_gp_pseudo_rtx == NULL_RTX)
- cfun->machine->mips16_gp_pseudo_rtx = gen_reg_rtx (Pmode);
+ if (MACHINE_FUNCTION (*cfun)->mips16_gp_pseudo_rtx == NULL_RTX)
+ MACHINE_FUNCTION (*cfun)->mips16_gp_pseudo_rtx = gen_reg_rtx (Pmode);
/* Don't emit an instruction to initialize the pseudo register if
we are being called from the tree optimizers' cost-calculation
routines. */
- if (!cfun->machine->initialized_mips16_gp_pseudo_p
+ if (!MACHINE_FUNCTION (*cfun)->initialized_mips16_gp_pseudo_p
&& (current_ir_type () != IR_GIMPLE || currently_expanding_to_rtl))
{
rtx insn, scan;
@@ -2639,15 +2639,15 @@ mips16_gp_pseudo_reg (void)
while (NEXT_INSN (scan) && !INSN_P (NEXT_INSN (scan)))
scan = NEXT_INSN (scan);
- insn = gen_load_const_gp (cfun->machine->mips16_gp_pseudo_rtx);
+ insn = gen_load_const_gp (MACHINE_FUNCTION (*cfun)->mips16_gp_pseudo_rtx);
emit_insn_after (insn, scan);
pop_topmost_sequence ();
- cfun->machine->initialized_mips16_gp_pseudo_p = true;
+ MACHINE_FUNCTION (*cfun)->initialized_mips16_gp_pseudo_p = true;
}
- return cfun->machine->mips16_gp_pseudo_rtx;
+ return MACHINE_FUNCTION (*cfun)->mips16_gp_pseudo_rtx;
}
/* Return a base register that holds pic_offset_table_rtx.
@@ -5377,8 +5377,8 @@ mips_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
}
}
if (REG_PARM_STACK_SPACE (cfun->decl) == 0)
- cfun->machine->varargs_size = (gp_saved * UNITS_PER_WORD
- + fp_saved * UNITS_PER_FPREG);
+ MACHINE_FUNCTION (*cfun)->varargs_size
+ = (gp_saved * UNITS_PER_WORD + fp_saved * UNITS_PER_FPREG);
}
/* Implement TARGET_BUILTIN_VA_LIST. */
@@ -5536,7 +5536,8 @@ mips_va_start (tree valist, rtx nextarg)
}
else
{
- nextarg = plus_constant (nextarg, -cfun->machine->varargs_size);
+ nextarg
+ = plus_constant (nextarg, -MACHINE_FUNCTION (*cfun)->varargs_size);
std_expand_builtin_va_start (valist, nextarg);
}
}
@@ -7831,9 +7832,9 @@ mips_debugger_offset (rtx addr, HOST_WIDE_INT offset)
|| reg == frame_pointer_rtx
|| reg == hard_frame_pointer_rtx)
{
- offset -= cfun->machine->frame.total_size;
+ offset -= MACHINE_FUNCTION (*cfun)->frame.total_size;
if (reg == hard_frame_pointer_rtx)
- offset += cfun->machine->frame.hard_frame_pointer_offset;
+ offset += MACHINE_FUNCTION (*cfun)->frame.hard_frame_pointer_offset;
}
/* sdbout_parms does not want this to crash for unrecognized cases. */
@@ -8368,9 +8369,11 @@ mips16e_collect_argument_save_p (rtx dest, rtx src, rtx *reg_values,
frame-pointer access. */
addr = mips16e_collect_propagate_value (XEXP (dest, 0), reg_values);
mips_split_plus (addr, &base, &offset);
- required_offset = cfun->machine->frame.total_size + argno * UNITS_PER_WORD;
+ required_offset
+ = MACHINE_FUNCTION (*cfun)->frame.total_size + argno * UNITS_PER_WORD;
if (base == hard_frame_pointer_rtx)
- required_offset -= cfun->machine->frame.hard_frame_pointer_offset;
+ required_offset
+ -= MACHINE_FUNCTION (*cfun)->frame.hard_frame_pointer_offset;
else if (base != stack_pointer_rtx)
return false;
if (offset != required_offset)
@@ -8414,7 +8417,7 @@ mips16e_collect_argument_saves (void)
src = SET_SRC (set);
if (mips16e_collect_argument_save_p (dest, src, reg_values, &regno))
{
- if (!BITSET_P (cfun->machine->frame.mask, regno))
+ if (!BITSET_P (MACHINE_FUNCTION (*cfun)->frame.mask, regno))
{
delete_insn (insn);
nargs = MAX (nargs, (regno - GP_ARG_FIRST) + 1);
@@ -8479,7 +8482,7 @@ mips16e_build_save_restore (bool restore_p, unsigned int *mask_ptr,
unsigned int i, regno;
int n;
- gcc_assert (cfun->machine->frame.num_fp == 0);
+ gcc_assert (MACHINE_FUNCTION (*cfun)->frame.num_fp == 0);
/* Calculate the number of elements in the PARALLEL. We need one element
for the stack adjustment, one for each argument register save, and one
@@ -8787,7 +8790,7 @@ mips_cfun_has_inflexible_gp_ref_p (void)
return true;
}
- return mips_find_gp_ref (&cfun->machine->has_inflexible_gp_insn_p,
+ return mips_find_gp_ref (&MACHINE_FUNCTION (*cfun)->has_inflexible_gp_insn_p,
mips_insn_has_inflexible_gp_ref_p);
}
@@ -8825,7 +8828,7 @@ mips_cfun_has_flexible_gp_ref_p (void)
if (TARGET_ABICALLS_PIC2 && !reload_completed && crtl->uses_const_pool)
return true;
- return mips_find_gp_ref (&cfun->machine->has_flexible_gp_insn_p,
+ return mips_find_gp_ref (&MACHINE_FUNCTION (*cfun)->has_flexible_gp_insn_p,
mips_insn_has_flexible_gp_ref_p);
}
@@ -8879,7 +8882,7 @@ mips_global_pointer (void)
We handle this as follows:
- (1) During reload, we set cfun->machine->global_pointer to
+ (1) During reload, we set MACHINE_FUNCTION (*cfun)->global_pointer to
INVALID_REGNUM if we _know_ that the current function
doesn't need a global pointer. This is only valid if
long branches don't need the GOT.
@@ -8887,7 +8890,7 @@ mips_global_pointer (void)
Otherwise, we assume that we might need a global pointer
and pick an appropriate register.
- (2) If cfun->machine->global_pointer != INVALID_REGNUM,
+ (2) If MACHINE_FUNCTION (*cfun)->global_pointer != INVALID_REGNUM,
we ensure that the global pointer is available at every
block boundary bar entry and exit. We do this in one of two ways:
@@ -8911,13 +8914,14 @@ mips_global_pointer (void)
(3) During prologue and epilogue generation, we emit "ghost"
placeholder instructions to manipulate the global pointer.
- (4) During prologue generation, we set cfun->machine->must_initialize_gp_p
- and cfun->machine->must_restore_gp_when_clobbered_p if we already know
- that the function needs a global pointer. (There is no need to set
+ (4) During prologue generation, we set
+ MACHINE_FUNCTION (*cfun)->must_initialize_gp_p and
+ MACHINE_FUNCTION (*cfun)->must_restore_gp_when_clobbered_p if we already
+ know that the function needs a global pointer. (There is no need to set
them earlier than this, and doing it as late as possible leads to
fewer false positives.)
- (5) If cfun->machine->must_initialize_gp_p is true during a
+ (5) If MACHINE_FUNCTION (*cfun)->must_initialize_gp_p is true during a
split_insns pass, we split the ghost instructions into real
instructions. These split instructions can then be optimized in
the usual way. Otherwise, we keep the ghost instructions intact,
@@ -8929,15 +8933,16 @@ mips_global_pointer (void)
stores $28 to the stack, but it handles the split form of
the ghost instruction as an ordinary store.
- (6) [OldABI only.] If cfun->machine->must_restore_gp_when_clobbered_p
+ (6) [OldABI only.] If
+ MACHINE_FUNCTION (*cfun)->must_restore_gp_when_clobbered_p
is true during the first post-epilogue split_insns pass, we split
calls and restore_gp patterns into instructions that explicitly
load pic_offset_table_rtx from the cprestore slot. Otherwise,
we split these patterns into instructions that _don't_ load from
the cprestore slot.
- If cfun->machine->must_restore_gp_when_clobbered_p is true at the
- time of the split, then any instructions that exist at that time
+ If MACHINE_FUNCTION (*cfun)->must_restore_gp_when_clobbered_p is true
+ at the time of the split, then any instructions that exist at that time
can make free use of pic_offset_table_rtx. However, if we want
to introduce new uses of the global pointer after the split,
we must explicitly load the value from the cprestore slot, since
@@ -8948,9 +8953,10 @@ mips_global_pointer (void)
loads from the cprestore slot in the usual case where no
long branches are needed.
- (7) If cfun->machine->must_initialize_gp_p is still false at the end
- of md_reorg, we decide whether the global pointer is needed for
- long branches. If so, we set cfun->machine->must_initialize_gp_p
+ (7) If MACHINE_FUNCTION (*cfun)->must_initialize_gp_p is still
+ false at the end of md_reorg, we decide whether the global
+ pointer is needed for long branches. If so, we set
+ MACHINE_FUNCTION (*cfun)->must_initialize_gp_p
to true and split the ghost instructions into real instructions
at that stage.
@@ -8975,7 +8981,7 @@ mips_global_pointer (void)
bool
mips_must_initialize_gp_p (void)
{
- return cfun->machine->must_initialize_gp_p;
+ return MACHINE_FUNCTION (*cfun)->must_initialize_gp_p;
}
/* Return true if REGNO is a register that is ordinarily call-clobbered
@@ -8990,7 +8996,7 @@ mips_interrupt_extra_call_saved_reg_p (unsigned int regno)
if (TARGET_DSP && DSP_ACC_REG_P (regno))
return true;
- if (GP_REG_P (regno) && !cfun->machine->use_shadow_register_set_p)
+ if (GP_REG_P (regno) && !MACHINE_FUNCTION (*cfun)->use_shadow_register_set_p)
{
/* $0 is hard-wired. */
if (regno == GP_REG_FIRST)
@@ -9021,7 +9027,7 @@ static bool
mips_cfun_call_saved_reg_p (unsigned int regno)
{
/* Interrupt handlers need to save extra registers. */
- if (cfun->machine->interrupt_handler_p
+ if (MACHINE_FUNCTION (*cfun)->interrupt_handler_p
&& mips_interrupt_extra_call_saved_reg_p (regno))
return true;
@@ -9059,7 +9065,7 @@ mips_cfun_might_clobber_call_saved_reg_p (unsigned int regno)
/* If we're using a call-saved global pointer, the function's
prologue will need to set it up. */
- if (cfun->machine->global_pointer == regno)
+ if (MACHINE_FUNCTION (*cfun)->global_pointer == regno)
return true;
/* The function's prologue will need to set the frame pointer if
@@ -9075,7 +9081,7 @@ mips_cfun_might_clobber_call_saved_reg_p (unsigned int regno)
/* If REGNO is ordinarily call-clobbered, we must assume that any
called function could modify it. */
- if (cfun->machine->interrupt_handler_p
+ if (MACHINE_FUNCTION (*cfun)->interrupt_handler_p
&& !current_function_is_leaf
&& mips_interrupt_extra_call_saved_reg_p (regno))
return true;
@@ -9198,22 +9204,22 @@ mips_compute_frame_info (void)
error ("interrupt handlers cannot be MIPS16 functions");
else
{
- cfun->machine->interrupt_handler_p = true;
- cfun->machine->use_shadow_register_set_p =
+ MACHINE_FUNCTION (*cfun)->interrupt_handler_p = true;
+ MACHINE_FUNCTION (*cfun)->use_shadow_register_set_p =
mips_use_shadow_register_set_p (TREE_TYPE (current_function_decl));
- cfun->machine->keep_interrupts_masked_p =
+ MACHINE_FUNCTION (*cfun)->keep_interrupts_masked_p =
mips_keep_interrupts_masked_p (TREE_TYPE (current_function_decl));
- cfun->machine->use_debug_exception_return_p =
+ MACHINE_FUNCTION (*cfun)->use_debug_exception_return_p =
mips_use_debug_exception_return_p (TREE_TYPE
(current_function_decl));
}
}
- frame = &cfun->machine->frame;
+ frame = &MACHINE_FUNCTION (*cfun)->frame;
memset (frame, 0, sizeof (*frame));
size = get_frame_size ();
- cfun->machine->global_pointer = mips_global_pointer ();
+ MACHINE_FUNCTION (*cfun)->global_pointer = mips_global_pointer ();
/* The first two blocks contain the outgoing argument area and the $gp save
slot. This area isn't needed in leaf functions, but if the
@@ -9295,7 +9301,7 @@ mips_compute_frame_info (void)
}
/* Add in space for the interrupt context information. */
- if (cfun->machine->interrupt_handler_p)
+ if (MACHINE_FUNCTION (*cfun)->interrupt_handler_p)
{
/* Check HI/LO. */
if (mips_save_reg_p (LO_REGNUM) || mips_save_reg_p (HI_REGNUM))
@@ -9316,7 +9322,7 @@ mips_compute_frame_info (void)
frame->num_cop0_regs++;
/* If we don't keep interrupts masked, we need to save EPC. */
- if (!cfun->machine->keep_interrupts_masked_p)
+ if (!MACHINE_FUNCTION (*cfun)->keep_interrupts_masked_p)
frame->num_cop0_regs++;
}
@@ -9336,7 +9342,7 @@ mips_compute_frame_info (void)
}
/* Move above the callee-allocated varargs save area. */
- offset += MIPS_STACK_ALIGN (cfun->machine->varargs_size);
+ offset += MIPS_STACK_ALIGN (MACHINE_FUNCTION (*cfun)->varargs_size);
frame->arg_pointer_offset = offset;
/* Move above the callee-allocated area for pretend stack arguments. */
@@ -9366,7 +9372,8 @@ mips_compute_frame_info (void)
enum mips_loadgp_style
mips_current_loadgp_style (void)
{
- if (!TARGET_USE_GOT || cfun->machine->global_pointer == INVALID_REGNUM)
+ if (!TARGET_USE_GOT
+ || MACHINE_FUNCTION (*cfun)->global_pointer == INVALID_REGNUM)
return LOADGP_NONE;
if (TARGET_RTP_PIC)
@@ -9395,7 +9402,7 @@ mips_frame_pointer_required (void)
if (TARGET_MIPS16)
{
mips_compute_frame_info ();
- if (!SMALL_OPERAND (cfun->machine->frame.total_size))
+ if (!SMALL_OPERAND (MACHINE_FUNCTION (*cfun)->frame.total_size))
return true;
}
@@ -9427,15 +9434,15 @@ mips_initial_elimination_offset (int from, int to)
{
case FRAME_POINTER_REGNUM:
if (FRAME_GROWS_DOWNWARD)
- offset = (cfun->machine->frame.args_size
- + cfun->machine->frame.cprestore_size
- + cfun->machine->frame.var_size);
+ offset = (MACHINE_FUNCTION (*cfun)->frame.args_size
+ + MACHINE_FUNCTION (*cfun)->frame.cprestore_size
+ + MACHINE_FUNCTION (*cfun)->frame.var_size);
else
offset = 0;
break;
case ARG_POINTER_REGNUM:
- offset = cfun->machine->frame.arg_pointer_offset;
+ offset = MACHINE_FUNCTION (*cfun)->frame.arg_pointer_offset;
break;
default:
@@ -9443,7 +9450,7 @@ mips_initial_elimination_offset (int from, int to)
}
if (to == HARD_FRAME_POINTER_REGNUM)
- offset -= cfun->machine->frame.hard_frame_pointer_offset;
+ offset -= MACHINE_FUNCTION (*cfun)->frame.hard_frame_pointer_offset;
return offset;
}
@@ -9491,9 +9498,10 @@ mips_set_return_address (rtx address, rtx scratch)
{
rtx slot_address;
- gcc_assert (BITSET_P (cfun->machine->frame.mask, RETURN_ADDR_REGNUM));
+ gcc_assert (BITSET_P (MACHINE_FUNCTION (*cfun)->frame.mask,
+ RETURN_ADDR_REGNUM));
slot_address = mips_add_offset (scratch, stack_pointer_rtx,
- cfun->machine->frame.gp_sp_offset);
+ MACHINE_FUNCTION (*cfun)->frame.gp_sp_offset);
mips_emit_move (gen_frame_mem (GET_MODE (address), slot_address), address);
}
@@ -9502,8 +9510,8 @@ mips_set_return_address (rtx address, rtx scratch)
bool
mips_cfun_has_cprestore_slot_p (void)
{
- return (cfun->machine->global_pointer != INVALID_REGNUM
- && cfun->machine->frame.cprestore_size > 0);
+ return (MACHINE_FUNCTION (*cfun)->global_pointer != INVALID_REGNUM
+ && MACHINE_FUNCTION (*cfun)->frame.cprestore_size > 0);
}
/* Fill *BASE and *OFFSET such that *BASE + *OFFSET refers to the
@@ -9517,7 +9525,7 @@ mips_get_cprestore_base_and_offset (rtx *base, HOST_WIDE_INT *offset,
{
const struct mips_frame_info *frame;
- frame = &cfun->machine->frame;
+ frame = &MACHINE_FUNCTION (*cfun)->frame;
/* .cprestore always uses the stack pointer instead of the frame pointer.
We have a free choice for direct stores for non-MIPS16 functions,
and for MIPS16 functions whose cprestore slot is in range of the
@@ -9599,7 +9607,7 @@ mips_restore_gp_from_cprestore_slot (rtx temp)
{
gcc_assert (TARGET_ABICALLS && TARGET_OLDABI && epilogue_completed);
- if (!cfun->machine->must_restore_gp_when_clobbered_p)
+ if (!MACHINE_FUNCTION (*cfun)->must_restore_gp_when_clobbered_p)
{
emit_note (NOTE_INSN_DELETED);
return;
@@ -9644,8 +9652,8 @@ mips_for_each_saved_acc (HOST_WIDE_INT sp_offset, mips_save_restore_fn fn)
HOST_WIDE_INT offset;
int regno;
- offset = cfun->machine->frame.acc_sp_offset - sp_offset;
- if (BITSET_P (cfun->machine->frame.acc_mask, 0))
+ offset = MACHINE_FUNCTION (*cfun)->frame.acc_sp_offset - sp_offset;
+ if (BITSET_P (MACHINE_FUNCTION (*cfun)->frame.acc_mask, 0))
{
mips_save_restore_reg (word_mode, LO_REGNUM, offset, fn);
offset -= UNITS_PER_WORD;
@@ -9654,7 +9662,7 @@ mips_for_each_saved_acc (HOST_WIDE_INT sp_offset, mips_save_restore_fn fn)
}
for (regno = DSP_ACC_REG_FIRST; regno <= DSP_ACC_REG_LAST; regno++)
- if (BITSET_P (cfun->machine->frame.acc_mask,
+ if (BITSET_P (MACHINE_FUNCTION (*cfun)->frame.acc_mask,
((regno - DSP_ACC_REG_FIRST) / 2) + 1))
{
mips_save_restore_reg (word_mode, regno, offset, fn);
@@ -9678,25 +9686,25 @@ mips_for_each_saved_gpr_and_fpr (HOST_WIDE_INT sp_offset,
the return register be stored at func+4, and also it allows us not to
need a nop in the epilogue if at least one register is reloaded in
addition to return address. */
- offset = cfun->machine->frame.gp_sp_offset - sp_offset;
+ offset = MACHINE_FUNCTION (*cfun)->frame.gp_sp_offset - sp_offset;
for (regno = GP_REG_LAST; regno >= GP_REG_FIRST; regno--)
- if (BITSET_P (cfun->machine->frame.mask, regno - GP_REG_FIRST))
+ if (BITSET_P (MACHINE_FUNCTION (*cfun)->frame.mask, regno - GP_REG_FIRST))
{
/* Record the ra offset for use by mips_function_profiler. */
if (regno == RETURN_ADDR_REGNUM)
- cfun->machine->frame.ra_fp_offset = offset + sp_offset;
+ MACHINE_FUNCTION (*cfun)->frame.ra_fp_offset = offset + sp_offset;
mips_save_restore_reg (word_mode, regno, offset, fn);
offset -= UNITS_PER_WORD;
}
/* This loop must iterate over the same space as its companion in
mips_compute_frame_info. */
- offset = cfun->machine->frame.fp_sp_offset - sp_offset;
+ offset = MACHINE_FUNCTION (*cfun)->frame.fp_sp_offset - sp_offset;
fpr_mode = (TARGET_SINGLE_FLOAT ? SFmode : DFmode);
for (regno = FP_REG_LAST - MAX_FPRS_PER_FMT + 1;
regno >= FP_REG_FIRST;
regno -= MAX_FPRS_PER_FMT)
- if (BITSET_P (cfun->machine->frame.fmask, regno - FP_REG_FIRST))
+ if (BITSET_P (MACHINE_FUNCTION (*cfun)->frame.fmask, regno - FP_REG_FIRST))
{
mips_save_restore_reg (fpr_mode, regno, offset, fn);
offset -= GET_MODE_SIZE (fpr_mode);
@@ -9739,7 +9747,8 @@ mips_emit_save_slot_move (rtx dest, rtx src, rtx temp)
mem = src;
}
- if (regno == cfun->machine->global_pointer && !mips_must_initialize_gp_p ())
+ if (regno == MACHINE_FUNCTION (*cfun)->global_pointer
+ && !mips_must_initialize_gp_p ())
{
/* We don't yet know whether we'll need this instruction or not.
Postpone the decision by emitting a ghost move. This move
@@ -9795,7 +9804,7 @@ mips_output_cplocal (void)
{
if (!TARGET_EXPLICIT_RELOCS
&& mips_must_initialize_gp_p ()
- && cfun->machine->global_pointer != GLOBAL_POINTER_REGNUM)
+ && MACHINE_FUNCTION (*cfun)->global_pointer != GLOBAL_POINTER_REGNUM)
output_asm_insn (".cplocal %+", 0);
}
@@ -9829,7 +9838,7 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
const struct mips_frame_info *frame;
- frame = &cfun->machine->frame;
+ frame = &MACHINE_FUNCTION (*cfun)->frame;
/* .frame FRAMEREG, FRAMESIZE, RETREG. */
fprintf (file,
@@ -9881,13 +9890,13 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
.set nomacro block. */
mips_push_asm_switch (&mips_noreorder);
output_asm_insn (".cpload\t%^", 0);
- if (!cfun->machine->all_noreorder_p)
+ if (!MACHINE_FUNCTION (*cfun)->all_noreorder_p)
mips_pop_asm_switch (&mips_noreorder);
else
mips_push_asm_switch (&mips_nomacro);
}
}
- else if (cfun->machine->all_noreorder_p)
+ else if (MACHINE_FUNCTION (*cfun)->all_noreorder_p)
{
mips_push_asm_switch (&mips_noreorder);
mips_push_asm_switch (&mips_nomacro);
@@ -9911,7 +9920,7 @@ mips_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
SET_REGNO (pic_offset_table_rtx, GLOBAL_POINTER_REGNUM);
mips_output_cplocal ();
- if (cfun->machine->all_noreorder_p)
+ if (MACHINE_FUNCTION (*cfun)->all_noreorder_p)
{
mips_pop_asm_switch (&mips_nomacro);
mips_pop_asm_switch (&mips_noreorder);
@@ -10027,7 +10036,7 @@ mips_expand_prologue (void)
unsigned int nargs;
rtx insn;
- if (cfun->machine->global_pointer != INVALID_REGNUM)
+ if (MACHINE_FUNCTION (*cfun)->global_pointer != INVALID_REGNUM)
{
/* Check whether an insn uses pic_offset_table_rtx, either explicitly
or implicitly. If so, we can commit to using a global pointer
@@ -10035,14 +10044,15 @@ mips_expand_prologue (void)
if (mips_cfun_has_inflexible_gp_ref_p ()
|| mips_cfun_has_flexible_gp_ref_p ())
{
- cfun->machine->must_initialize_gp_p = true;
- cfun->machine->must_restore_gp_when_clobbered_p = true;
+ MACHINE_FUNCTION (*cfun)->must_initialize_gp_p = true;
+ MACHINE_FUNCTION (*cfun)->must_restore_gp_when_clobbered_p = true;
}
- SET_REGNO (pic_offset_table_rtx, cfun->machine->global_pointer);
+ SET_REGNO (pic_offset_table_rtx,
+ MACHINE_FUNCTION (*cfun)->global_pointer);
}
- frame = &cfun->machine->frame;
+ frame = &MACHINE_FUNCTION (*cfun)->frame;
size = frame->total_size;
/* Save the registers. Allocate up to MIPS_MAX_FIRST_STACK_STEP
@@ -10080,18 +10090,18 @@ mips_expand_prologue (void)
}
else
{
- if (cfun->machine->interrupt_handler_p)
+ if (MACHINE_FUNCTION (*cfun)->interrupt_handler_p)
{
HOST_WIDE_INT offset;
rtx mem;
/* If this interrupt is using a shadow register set, we need to
get the stack pointer from the previous register set. */
- if (cfun->machine->use_shadow_register_set_p)
+ if (MACHINE_FUNCTION (*cfun)->use_shadow_register_set_p)
emit_insn (gen_mips_rdpgpr (stack_pointer_rtx,
stack_pointer_rtx));
- if (!cfun->machine->keep_interrupts_masked_p)
+ if (!MACHINE_FUNCTION (*cfun)->keep_interrupts_masked_p)
{
/* Move from COP0 Cause to K0. */
emit_insn (gen_cop0_move (gen_rtx_REG (SImode, K0_REG_NUM),
@@ -10111,7 +10121,7 @@ mips_expand_prologue (void)
/* Start at the uppermost location for saving. */
offset = frame->cop0_sp_offset - size;
- if (!cfun->machine->keep_interrupts_masked_p)
+ if (!MACHINE_FUNCTION (*cfun)->keep_interrupts_masked_p)
{
/* Push EPC into its stack slot. */
mem = gen_frame_mem (word_mode,
@@ -10127,7 +10137,7 @@ mips_expand_prologue (void)
COP0_STATUS_REG_NUM)));
/* Right justify the RIPL in k0. */
- if (!cfun->machine->keep_interrupts_masked_p)
+ if (!MACHINE_FUNCTION (*cfun)->keep_interrupts_masked_p)
emit_insn (gen_lshrsi3 (gen_rtx_REG (SImode, K0_REG_NUM),
gen_rtx_REG (SImode, K0_REG_NUM),
GEN_INT (CAUSE_IPL)));
@@ -10139,13 +10149,13 @@ mips_expand_prologue (void)
offset -= UNITS_PER_WORD;
/* Insert the RIPL into our copy of SR (k1) as the new IPL. */
- if (!cfun->machine->keep_interrupts_masked_p)
+ if (!MACHINE_FUNCTION (*cfun)->keep_interrupts_masked_p)
emit_insn (gen_insvsi (gen_rtx_REG (SImode, K1_REG_NUM),
GEN_INT (6),
GEN_INT (SR_IPL),
gen_rtx_REG (SImode, K0_REG_NUM)));
- if (!cfun->machine->keep_interrupts_masked_p)
+ if (!MACHINE_FUNCTION (*cfun)->keep_interrupts_masked_p)
/* Enable interrupts by clearing the KSU ERL and EXL bits.
IE is already the correct value, so we don't have to do
anything explicit. */
@@ -10261,7 +10271,7 @@ mips_expand_prologue (void)
}
/* We need to search back to the last use of K0 or K1. */
- if (cfun->machine->interrupt_handler_p)
+ if (MACHINE_FUNCTION (*cfun)->interrupt_handler_p)
{
for (insn = get_last_insn (); insn != NULL_RTX; insn = PREV_INSN (insn))
if (INSN_P (insn)
@@ -10337,7 +10347,7 @@ mips_expand_epilogue (bool sibcall_p)
should deallocate afterwards.
Start off by assuming that no registers need to be restored. */
- frame = &cfun->machine->frame;
+ frame = &MACHINE_FUNCTION (*cfun)->frame;
step1 = frame->total_size;
step2 = 0;
@@ -10419,13 +10429,13 @@ mips_expand_epilogue (bool sibcall_p)
mips_for_each_saved_gpr_and_fpr (frame->total_size - step2,
mips_restore_reg);
- if (cfun->machine->interrupt_handler_p)
+ if (MACHINE_FUNCTION (*cfun)->interrupt_handler_p)
{
HOST_WIDE_INT offset;
rtx mem;
offset = frame->cop0_sp_offset - (frame->total_size - step2);
- if (!cfun->machine->keep_interrupts_masked_p)
+ if (!MACHINE_FUNCTION (*cfun)->keep_interrupts_masked_p)
{
/* Restore the original EPC. */
mem = gen_frame_mem (word_mode,
@@ -10445,7 +10455,7 @@ mips_expand_epilogue (bool sibcall_p)
offset -= UNITS_PER_WORD;
/* If we don't use shoadow register set, we need to update SP. */
- if (!cfun->machine->use_shadow_register_set_p && step2 > 0)
+ if (!MACHINE_FUNCTION (*cfun)->use_shadow_register_set_p && step2 > 0)
emit_insn (gen_add3_insn (stack_pointer_rtx,
stack_pointer_rtx,
GEN_INT (step2)));
@@ -10485,10 +10495,10 @@ mips_expand_epilogue (bool sibcall_p)
if (!sibcall_p)
{
mips_expand_before_return ();
- if (cfun->machine->interrupt_handler_p)
+ if (MACHINE_FUNCTION (*cfun)->interrupt_handler_p)
{
/* Interrupt handlers generate eret or deret. */
- if (cfun->machine->use_debug_exception_return_p)
+ if (MACHINE_FUNCTION (*cfun)->use_debug_exception_return_p)
emit_jump_insn (gen_mips_deret ());
else
emit_jump_insn (gen_mips_eret ());
@@ -10511,8 +10521,8 @@ mips_expand_epilogue (bool sibcall_p)
}
/* Search from the beginning to the first use of K0 or K1. */
- if (cfun->machine->interrupt_handler_p
- && !cfun->machine->keep_interrupts_masked_p)
+ if (MACHINE_FUNCTION (*cfun)->interrupt_handler_p
+ && !MACHINE_FUNCTION (*cfun)->keep_interrupts_masked_p)
{
for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
if (INSN_P (insn)
@@ -10533,7 +10543,7 @@ bool
mips_can_use_return_insn (void)
{
/* Interrupt handlers need to go through the epilogue. */
- if (cfun->machine->interrupt_handler_p)
+ if (MACHINE_FUNCTION (*cfun)->interrupt_handler_p)
return false;
if (!reload_completed)
@@ -10548,7 +10558,7 @@ mips_can_use_return_insn (void)
if (mips16_cfun_returns_in_fpr_p ())
return false;
- return cfun->machine->frame.total_size == 0;
+ return MACHINE_FUNCTION (*cfun)->frame.total_size == 0;
}
/* Return true if register REGNO can store a value of mode MODE.
@@ -11223,12 +11233,12 @@ mips_process_load_label (rtx target)
static unsigned int
mips_load_label_length (void)
{
- if (cfun->machine->load_label_length == 0)
+ if (MACHINE_FUNCTION (*cfun)->load_label_length == 0)
{
mips_process_load_label (pc_rtx);
- cfun->machine->load_label_length = mips_multi_num_insns;
+ MACHINE_FUNCTION (*cfun)->load_label_length = mips_multi_num_insns;
}
- return cfun->machine->load_label_length;
+ return MACHINE_FUNCTION (*cfun)->load_label_length;
}
/* Emit an asm sequence to start a noat block and load the address
@@ -11280,7 +11290,8 @@ mips_adjust_insn_length (rtx insn, int length)
length += 4;
/* See how many nops might be needed to avoid hardware hazards. */
- if (!cfun->machine->ignore_hazard_length_p && INSN_CODE (insn) >= 0)
+ if (!MACHINE_FUNCTION (*cfun)->ignore_hazard_length_p
+ && INSN_CODE (insn) >= 0)
switch (get_attr_hazard (insn))
{
case HAZARD_NONE:
@@ -13806,8 +13817,8 @@ r10k_safe_address_p (rtx x, rtx insn)
is safe from speculation at any point in the function. */
mips_split_plus (x, &base, &offset_val);
if (base == virtual_incoming_args_rtx
- && offset_val >= -cfun->machine->frame.total_size
- && offset_val < cfun->machine->frame.args_size)
+ && offset_val >= -MACHINE_FUNCTION (*cfun)->frame.total_size
+ && offset_val < MACHINE_FUNCTION (*cfun)->frame.args_size)
return true;
/* Check for uncached addresses. */
@@ -14726,7 +14737,7 @@ mips_avoid_hazard (rtx after, rtx insn, int *hilo_delay,
an asm statement. We don't know whether there will be hazards
between the asm statement and the gcc-generated code. */
if (GET_CODE (pattern) == ASM_INPUT || asm_noperands (pattern) >= 0)
- cfun->machine->all_noreorder_p = false;
+ MACHINE_FUNCTION (*cfun)->all_noreorder_p = false;
/* Ignore zero-length instructions (barriers and the like). */
ninsns = get_attr_length (insn) / 4;
@@ -14787,36 +14798,36 @@ mips_reorg_process_insns (void)
split_all_insns_noflow ();
/* Recalculate instruction lengths without taking nops into account. */
- cfun->machine->ignore_hazard_length_p = true;
+ MACHINE_FUNCTION (*cfun)->ignore_hazard_length_p = true;
shorten_branches (get_insns ());
- cfun->machine->all_noreorder_p = true;
+ MACHINE_FUNCTION (*cfun)->all_noreorder_p = true;
/* We don't track MIPS16 PC-relative offsets closely enough to make
a good job of "set .noreorder" code in MIPS16 mode. */
if (TARGET_MIPS16)
- cfun->machine->all_noreorder_p = false;
+ MACHINE_FUNCTION (*cfun)->all_noreorder_p = false;
/* Code that doesn't use explicit relocs can't be ".set nomacro". */
if (!TARGET_EXPLICIT_RELOCS)
- cfun->machine->all_noreorder_p = false;
+ MACHINE_FUNCTION (*cfun)->all_noreorder_p = false;
/* Profiled functions can't be all noreorder because the profiler
support uses assembler macros. */
if (crtl->profile)
- cfun->machine->all_noreorder_p = false;
+ MACHINE_FUNCTION (*cfun)->all_noreorder_p = false;
/* Code compiled with -mfix-vr4120 can't be all noreorder because
we rely on the assembler to work around some errata. */
if (TARGET_FIX_VR4120)
- cfun->machine->all_noreorder_p = false;
+ MACHINE_FUNCTION (*cfun)->all_noreorder_p = false;
/* The same is true for -mfix-vr4130 if we might generate MFLO or
MFHI instructions. Note that we avoid using MFLO and MFHI if
the VR4130 MACC and DMACC instructions are available instead;
see the *mfhilo_{si,di}_macc patterns. */
if (TARGET_FIX_VR4130 && !ISA_HAS_MACCHI)
- cfun->machine->all_noreorder_p = false;
+ MACHINE_FUNCTION (*cfun)->all_noreorder_p = false;
htab = htab_create (37, mips_lo_sum_offset_hash,
mips_lo_sum_offset_eq, free);
@@ -14897,7 +14908,7 @@ mips_expand_ghost_gp_insns (void)
/* Quick exit if we already know that we will or won't need a
global pointer. */
if (!TARGET_USE_GOT
- || cfun->machine->global_pointer == INVALID_REGNUM
+ || MACHINE_FUNCTION (*cfun)->global_pointer == INVALID_REGNUM
|| mips_must_initialize_gp_p ())
return false;
@@ -14918,7 +14929,7 @@ mips_expand_ghost_gp_insns (void)
return false;
/* We've now established that we need $gp. */
- cfun->machine->must_initialize_gp_p = true;
+ MACHINE_FUNCTION (*cfun)->must_initialize_gp_p = true;
split_all_insns_noflow ();
return true;
@@ -15003,10 +15014,11 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
{
/* Pick a global pointer. Use a call-clobbered register if
TARGET_CALL_SAVED_GP. */
- cfun->machine->global_pointer
+ MACHINE_FUNCTION (*cfun)->global_pointer
= TARGET_CALL_SAVED_GP ? 15 : GLOBAL_POINTER_REGNUM;
- cfun->machine->must_initialize_gp_p = true;
- SET_REGNO (pic_offset_table_rtx, cfun->machine->global_pointer);
+ MACHINE_FUNCTION (*cfun)->must_initialize_gp_p = true;
+ SET_REGNO (pic_offset_table_rtx,
+ MACHINE_FUNCTION (*cfun)->global_pointer);
/* Set up the global pointer for n32 or n64 abicalls. */
mips_emit_loadgp ();
@@ -15956,7 +15968,7 @@ mips_eh_uses (unsigned int regno)
}
else
{
- if (cfun->machine->global_pointer == regno)
+ if (MACHINE_FUNCTION (*cfun)->global_pointer == regno)
return true;
}
}
@@ -15982,7 +15994,7 @@ mips_epilogue_uses (unsigned int regno)
/* An interrupt handler must preserve some registers that are
ordinarily call-clobbered. */
- if (cfun->machine->interrupt_handler_p
+ if (MACHINE_FUNCTION (*cfun)->interrupt_handler_p
&& mips_interrupt_extra_call_saved_reg_p (regno))
return true;
@@ -16251,13 +16263,13 @@ void mips_function_profiler (FILE *file)
{
/* If TARGET_MCOUNT_RA_ADDRESS load $12 with the address of the
ra save location. */
- if (cfun->machine->frame.ra_fp_offset == 0)
+ if (MACHINE_FUNCTION (*cfun)->frame.ra_fp_offset == 0)
/* ra not saved, pass zero. */
fprintf (file, "\tmove\t%s,%s\n", reg_names[12], reg_names[0]);
else
fprintf (file, "\t%s\t%s," HOST_WIDE_INT_PRINT_DEC "(%s)\n",
Pmode == DImode ? "dla" : "la", reg_names[12],
- cfun->machine->frame.ra_fp_offset,
+ MACHINE_FUNCTION (*cfun)->frame.ra_fp_offset,
reg_names[STACK_POINTER_REGNUM]);
}
if (!TARGET_NEWABI)
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 4026bd73714..da769cdd5b9 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -1782,9 +1782,10 @@ enum mips_code_readable_setting {
#define MIPS16_PIC_TEMP_REGNUM (GP_REG_FIRST + 2)
#define MIPS_PROLOGUE_TEMP_REGNUM \
- (cfun->machine->interrupt_handler_p ? K0_REG_NUM : GP_REG_FIRST + 3)
+ (MACHINE_FUNCTION (*cfun)->interrupt_handler_p\
+ ? K0_REG_NUM : GP_REG_FIRST + 3)
#define MIPS_EPILOGUE_TEMP_REGNUM \
- (cfun->machine->interrupt_handler_p \
+ (MACHINE_FUNCTION (*cfun)->interrupt_handler_p\
? K0_REG_NUM \
: GP_REG_FIRST + (TARGET_MIPS16 ? 6 : 8))
diff --git a/gcc/config/mips/sde.h b/gcc/config/mips/sde.h
index d2a32967b75..87900bfe6ee 100644
--- a/gcc/config/mips/sde.h
+++ b/gcc/config/mips/sde.h
@@ -91,7 +91,8 @@ along with GCC; see the file COPYING3. If not see
/* Use $5 as a temporary for both MIPS16 and non-MIPS16. */
#undef MIPS_EPILOGUE_TEMP_REGNUM
#define MIPS_EPILOGUE_TEMP_REGNUM \
- (cfun->machine->interrupt_handler_p ? K0_REG_NUM : GP_REG_FIRST + 5)
+ (MACHINE_FUNCTION (*cfun)->interrupt_handler_p \
+ ? K0_REG_NUM : GP_REG_FIRST + 5)
/* Using long will always be right for size_t and ptrdiff_t, since
sizeof(long) must equal sizeof(void *), following from the setting
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 24d2c46eff6..35d2da4799d 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -50,7 +50,8 @@ along with GCC; see the file COPYING3. If not see
/* We'd need a current_function_has_landing_pad. It's marked as such when
a nonlocal_goto_receiver is expanded. Not just a C++ thing, but
mostly. */
-#define MMIX_CFUN_HAS_LANDING_PAD (cfun->machine->has_landing_pad != 0)
+#define MMIX_CFUN_HAS_LANDING_PAD \
+ (MACHINE_FUNCTION (*cfun)->has_landing_pad != 0)
/* We have no means to tell DWARF 2 about the register stack, so we need
to store the return address on the stack if an exception can get into
@@ -87,10 +88,10 @@ along with GCC; see the file COPYING3. If not see
|| (int) (N) < MMIX_RETURN_VALUE_REGNUM \
|| (int) (N) > MMIX_LAST_STACK_REGISTER_REGNUM \
|| cfun == NULL \
- || cfun->machine == NULL \
- || cfun->machine->in_prologue \
+ || MACHINE_FUNCTION (*cfun) == NULL \
+ || MACHINE_FUNCTION (*cfun)->in_prologue \
? (N) : ((N) - MMIX_RETURN_VALUE_REGNUM \
- + cfun->machine->highest_saved_stack_register + 1))
+ + MACHINE_FUNCTION (*cfun)->highest_saved_stack_register + 1))
/* The %d in "POP %d,0". */
#define MMIX_POP_ARGUMENT() \
@@ -793,7 +794,7 @@ static void
mmix_target_asm_function_prologue (FILE *stream ATTRIBUTE_UNUSED,
HOST_WIDE_INT framesize ATTRIBUTE_UNUSED)
{
- cfun->machine->in_prologue = 1;
+ MACHINE_FUNCTION (*cfun)->in_prologue = 1;
}
/* Make a note that we've seen the end of the prologue. */
@@ -801,7 +802,7 @@ mmix_target_asm_function_prologue (FILE *stream ATTRIBUTE_UNUSED,
static void
mmix_target_asm_function_end_prologue (FILE *stream ATTRIBUTE_UNUSED)
{
- cfun->machine->in_prologue = 0;
+ MACHINE_FUNCTION (*cfun)->in_prologue = 0;
}
/* Implement TARGET_MACHINE_DEPENDENT_REORG. No actual rearrangements
@@ -843,7 +844,7 @@ mmix_reorg (void)
regno = MMIX_RETURN_VALUE_REGNUM - 1;
}
- cfun->machine->highest_saved_stack_register = regno;
+ MACHINE_FUNCTION (*cfun)->highest_saved_stack_register = regno;
}
/* TARGET_ASM_FUNCTION_EPILOGUE. */
@@ -1606,7 +1607,7 @@ mmix_print_operand (FILE *stream, rtx x, int code)
registers to pass, but we don't use it currently. Anyway, we
need to output the number of saved registers here. */
fprintf (stream, "%d",
- cfun->machine->highest_saved_stack_register + 1);
+ MACHINE_FUNCTION (*cfun)->highest_saved_stack_register + 1);
return;
case 'r':
diff --git a/gcc/config/mmix/mmix.md b/gcc/config/mmix/mmix.md
index 8c3109b57b3..dc9f34d7714 100644
--- a/gcc/config/mmix/mmix.md
+++ b/gcc/config/mmix/mmix.md
@@ -1130,7 +1130,7 @@ DIVU %1,%1,%2\;GET %0,:rR\;NEGU %2,0,%0\;CSNN %0,$255,%2")
MMIX_INCOMING_RETURN_ADDRESS_REGNUM);
/* Mark this function as containing a landing-pad. */
- cfun->machine->has_landing_pad = 1;
+ MACHINE_FUNCTION (*cfun)->has_landing_pad = 1;
}")
;; GCC can insist on using saved registers to keep the slot address in
diff --git a/gcc/config/moxie/moxie.c b/gcc/config/moxie/moxie.c
index 1ce7107daff..f397f28dbf8 100644
--- a/gcc/config/moxie/moxie.c
+++ b/gcc/config/moxie/moxie.c
@@ -251,25 +251,25 @@ moxie_compute_frame (void)
int regno;
/* Padding needed for each element of the frame. */
- cfun->machine->local_vars_size = get_frame_size ();
+ MACHINE_FUNCTION (*cfun)->local_vars_size = get_frame_size ();
/* Align to the stack alignment. */
- padding_locals = cfun->machine->local_vars_size % stack_alignment;
+ padding_locals = MACHINE_FUNCTION (*cfun)->local_vars_size % stack_alignment;
if (padding_locals)
padding_locals = stack_alignment - padding_locals;
- cfun->machine->local_vars_size += padding_locals;
+ MACHINE_FUNCTION (*cfun)->local_vars_size += padding_locals;
- cfun->machine->callee_saved_reg_size = 0;
+ MACHINE_FUNCTION (*cfun)->callee_saved_reg_size = 0;
/* Save callee-saved registers. */
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (df_regs_ever_live_p (regno) && (! call_used_regs[regno]))
- cfun->machine->callee_saved_reg_size += 4;
+ MACHINE_FUNCTION (*cfun)->callee_saved_reg_size += 4;
- cfun->machine->size_for_adjusting_sp =
+ MACHINE_FUNCTION (*cfun)->size_for_adjusting_sp =
crtl->args.pretend_args_size
- + cfun->machine->local_vars_size
+ + MACHINE_FUNCTION (*cfun)->local_vars_size
+ (ACCUMULATE_OUTGOING_ARGS ? crtl->outgoing_args_size : 0);
}
@@ -291,9 +291,9 @@ moxie_expand_prologue (void)
}
}
- if (cfun->machine->size_for_adjusting_sp > 0)
+ if (MACHINE_FUNCTION (*cfun)->size_for_adjusting_sp > 0)
{
- int i = cfun->machine->size_for_adjusting_sp;
+ int i = MACHINE_FUNCTION (*cfun)->size_for_adjusting_sp;
while (i > 255)
{
insn = emit_insn (gen_subsi3 (stack_pointer_rtx,
@@ -318,20 +318,22 @@ moxie_expand_epilogue (void)
int regno;
rtx insn, reg, cfa_restores = NULL;
- if (cfun->machine->callee_saved_reg_size != 0)
+ if (MACHINE_FUNCTION (*cfun)->callee_saved_reg_size != 0)
{
reg = gen_rtx_REG (Pmode, MOXIE_R5);
- if (cfun->machine->callee_saved_reg_size <= 255)
+ if (MACHINE_FUNCTION (*cfun)->callee_saved_reg_size <= 255)
{
emit_move_insn (reg, hard_frame_pointer_rtx);
emit_insn (gen_subsi3
(reg, reg,
- GEN_INT (cfun->machine->callee_saved_reg_size)));
+ (GEN_INT
+ (MACHINE_FUNCTION (*cfun)->callee_saved_reg_size))));
}
else
{
emit_move_insn (reg,
- GEN_INT (-cfun->machine->callee_saved_reg_size));
+ (GEN_INT
+ (-MACHINE_FUNCTION (*cfun)->callee_saved_reg_size)));
emit_insn (gen_addsi3 (reg, reg, hard_frame_pointer_rtx));
}
for (regno = FIRST_PSEUDO_REGISTER; regno-- > 0; )
@@ -355,9 +357,10 @@ moxie_initial_elimination_offset (int from, int to)
if ((from) == FRAME_POINTER_REGNUM && (to) == HARD_FRAME_POINTER_REGNUM)
{
- /* Compute this since we need to use cfun->machine->local_vars_size. */
+ /* Compute this since we need to use
+ MACHINE_FUNCTION (*cfun)->local_vars_size. */
moxie_compute_frame ();
- ret = -cfun->machine->callee_saved_reg_size;
+ ret = -MACHINE_FUNCTION (*cfun)->callee_saved_reg_size;
}
else if ((from) == ARG_POINTER_REGNUM && (to) == HARD_FRAME_POINTER_REGNUM)
ret = 0x00;
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 5f42a1ac622..b5693a77cfa 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -4061,7 +4061,7 @@ pa_output_function_epilogue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
debug information. Forget that we are in this subspace to ensure
that the next function is output in its own subspace. */
in_section = NULL;
- cfun->machine->in_nsubspa = 2;
+ MACHINE_FUNCTION (*cfun)->in_nsubspa = 2;
}
if (INSN_ADDRESSES_SET_P ())
@@ -8240,7 +8240,7 @@ pa_asm_output_mi_thunk (FILE *file, tree thunk_fndecl, HOST_WIDE_INT delta,
debug information. Forget that we are in this subspace to ensure
that the next function is output in its own subspace. */
in_section = NULL;
- cfun->machine->in_nsubspa = 2;
+ MACHINE_FUNCTION (*cfun)->in_nsubspa = 2;
}
if (TARGET_SOM && flag_pic && TREE_PUBLIC (function))
@@ -9533,11 +9533,12 @@ som_output_text_section_asm_op (const void *data ATTRIBUTE_UNUSED)
gcc_assert (TARGET_SOM);
if (TARGET_GAS)
{
- if (cfun && cfun->machine && !cfun->machine->in_nsubspa)
+ if (cfun && MACHINE_FUNCTION (*cfun)
+ && !MACHINE_FUNCTION (*cfun)->in_nsubspa)
{
/* We only want to emit a .nsubspa directive once at the
start of the function. */
- cfun->machine->in_nsubspa = 1;
+ MACHINE_FUNCTION (*cfun)->in_nsubspa = 1;
/* Create a new subspace for the text. This provides
better stub placement and one-only functions. */
@@ -9558,8 +9559,8 @@ som_output_text_section_asm_op (const void *data ATTRIBUTE_UNUSED)
text section to output debugging information. Thus, we
need to forget that we are in the text section so that
varasm.c will call us when text_section is selected again. */
- gcc_assert (!cfun || !cfun->machine
- || cfun->machine->in_nsubspa == 2);
+ gcc_assert (!cfun || !MACHINE_FUNCTION (*cfun)
+ || MACHINE_FUNCTION (*cfun)->in_nsubspa == 2);
in_section = NULL;
}
output_section_asm_op ("\t.SPACE $TEXT$\n\t.NSUBSPA $CODE$");
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index fe6a9001a4e..1bb50b5fa70 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -6777,14 +6777,16 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode)
return;
}
- if (reload_in_progress && cfun->machine->sdmode_stack_slot != NULL_RTX)
- cfun->machine->sdmode_stack_slot =
- eliminate_regs (cfun->machine->sdmode_stack_slot, VOIDmode, NULL_RTX);
+ if (reload_in_progress
+ && MACHINE_FUNCTION (*cfun)->sdmode_stack_slot != NULL_RTX)
+ MACHINE_FUNCTION (*cfun)->sdmode_stack_slot =
+ eliminate_regs (MACHINE_FUNCTION (*cfun)->sdmode_stack_slot, VOIDmode,
+ NULL_RTX);
if (reload_in_progress
&& mode == SDmode
&& MEM_P (operands[0])
- && rtx_equal_p (operands[0], cfun->machine->sdmode_stack_slot)
+ && rtx_equal_p (operands[0], MACHINE_FUNCTION (*cfun)->sdmode_stack_slot)
&& REG_P (operands[1]))
{
if (FP_REGNO_P (REGNO (operands[1])))
@@ -6807,7 +6809,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode)
&& mode == SDmode
&& REG_P (operands[0])
&& MEM_P (operands[1])
- && rtx_equal_p (operands[1], cfun->machine->sdmode_stack_slot))
+ && rtx_equal_p (operands[1], MACHINE_FUNCTION (*cfun)->sdmode_stack_slot))
{
if (FP_REGNO_P (REGNO (operands[0])))
{
@@ -8509,7 +8511,7 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
gcc_assert (reg_save_area == virtual_stack_vars_rtx);
}
- cfun->machine->varargs_save_offset = offset;
+ MACHINE_FUNCTION (*cfun)->varargs_save_offset = offset;
save_area = plus_constant (virtual_stack_vars_rtx, offset);
}
}
@@ -8727,9 +8729,9 @@ rs6000_va_start (tree valist, rtx nextarg)
/* Find the register save area. */
t = make_tree (TREE_TYPE (sav), virtual_stack_vars_rtx);
- if (cfun->machine->varargs_save_offset)
+ if (MACHINE_FUNCTION (*cfun)->varargs_save_offset)
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (sav), t,
- size_int (cfun->machine->varargs_save_offset));
+ size_int (MACHINE_FUNCTION (*cfun)->varargs_save_offset));
t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -13606,13 +13608,13 @@ rs6000_secondary_memory_needed_rtx (enum machine_mode mode)
ret = assign_stack_local (mode, GET_MODE_SIZE (mode), 0);
else
{
- rtx mem = cfun->machine->sdmode_stack_slot;
+ rtx mem = MACHINE_FUNCTION (*cfun)->sdmode_stack_slot;
gcc_assert (mem != NULL_RTX);
if (!eliminated)
{
mem = eliminate_regs (mem, VOIDmode, NULL_RTX);
- cfun->machine->sdmode_stack_slot = mem;
+ MACHINE_FUNCTION (*cfun)->sdmode_stack_slot = mem;
eliminated = true;
}
ret = mem;
@@ -14113,7 +14115,7 @@ rs6000_alloc_sdmode_stack_slot (void)
basic_block bb;
gimple_stmt_iterator gsi;
- gcc_assert (cfun->machine->sdmode_stack_slot == NULL_RTX);
+ gcc_assert (MACHINE_FUNCTION (*cfun)->sdmode_stack_slot == NULL_RTX);
FOR_EACH_BB (bb)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
@@ -14122,8 +14124,8 @@ rs6000_alloc_sdmode_stack_slot (void)
if (ret)
{
rtx stack = assign_stack_local (DDmode, GET_MODE_SIZE (DDmode), 0);
- cfun->machine->sdmode_stack_slot = adjust_address_nv (stack,
- SDmode, 0);
+ MACHINE_FUNCTION (*cfun)->sdmode_stack_slot
+ = adjust_address_nv (stack, SDmode, 0);
return;
}
}
@@ -14138,8 +14140,8 @@ rs6000_alloc_sdmode_stack_slot (void)
|| TYPE_MODE (DECL_ARG_TYPE (t)) == SDmode)
{
rtx stack = assign_stack_local (DDmode, GET_MODE_SIZE (DDmode), 0);
- cfun->machine->sdmode_stack_slot = adjust_address_nv (stack,
- SDmode, 0);
+ MACHINE_FUNCTION (*cfun)->sdmode_stack_slot
+ = adjust_address_nv (stack, SDmode, 0);
return;
}
}
@@ -14148,8 +14150,8 @@ rs6000_alloc_sdmode_stack_slot (void)
static void
rs6000_instantiate_decls (void)
{
- if (cfun->machine->sdmode_stack_slot != NULL_RTX)
- instantiate_decl_rtl (cfun->machine->sdmode_stack_slot);
+ if (MACHINE_FUNCTION (*cfun)->sdmode_stack_slot != NULL_RTX)
+ instantiate_decl_rtl (MACHINE_FUNCTION (*cfun)->sdmode_stack_slot);
}
/* Given an rtx X being reloaded into a reg required to be
@@ -14619,14 +14621,14 @@ rs6000_get_some_local_dynamic_name (void)
{
rtx insn;
- if (cfun->machine->some_ld_name)
- return cfun->machine->some_ld_name;
+ if (MACHINE_FUNCTION (*cfun)->some_ld_name)
+ return MACHINE_FUNCTION (*cfun)->some_ld_name;
for (insn = get_insns (); insn ; insn = NEXT_INSN (insn))
if (INSN_P (insn)
&& for_each_rtx (&PATTERN (insn),
rs6000_get_some_local_dynamic_name_1, 0))
- return cfun->machine->some_ld_name;
+ return MACHINE_FUNCTION (*cfun)->some_ld_name;
gcc_unreachable ();
}
@@ -14643,7 +14645,7 @@ rs6000_get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
const char *str = XSTR (x, 0);
if (SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC)
{
- cfun->machine->some_ld_name = str;
+ MACHINE_FUNCTION (*cfun)->some_ld_name = str;
return 1;
}
}
@@ -17555,10 +17557,11 @@ rs6000_stack_info (void)
if (TARGET_SPE)
{
/* Cache value so we don't rescan instruction chain over and over. */
- if (cfun->machine->insn_chain_scanned_p == 0)
- cfun->machine->insn_chain_scanned_p
+ if (MACHINE_FUNCTION (*cfun)->insn_chain_scanned_p == 0)
+ MACHINE_FUNCTION (*cfun)->insn_chain_scanned_p
= spe_func_has_64bit_regs_p () + 1;
- info_ptr->spe_64bit_regs_used = cfun->machine->insn_chain_scanned_p - 1;
+ info_ptr->spe_64bit_regs_used
+ = MACHINE_FUNCTION (*cfun)->insn_chain_scanned_p - 1;
}
/* Select which calling sequence. */
@@ -17605,7 +17608,7 @@ rs6000_stack_info (void)
/* Does this function call anything? */
info_ptr->calls_p = (! current_function_is_leaf
- || cfun->machine->ra_needs_full_frame);
+ || MACHINE_FUNCTION (*cfun)->ra_needs_full_frame);
/* Determine if we need to save the link register. */
if ((DEFAULT_ABI == ABI_AIX
@@ -18031,7 +18034,7 @@ rs6000_return_addr (int count, rtx frame)
don't try to be too clever here. */
if (count != 0 || (DEFAULT_ABI != ABI_AIX && flag_pic))
{
- cfun->machine->ra_needs_full_frame = 1;
+ MACHINE_FUNCTION (*cfun)->ra_needs_full_frame = 1;
return
gen_rtx_MEM
@@ -18044,7 +18047,7 @@ rs6000_return_addr (int count, rtx frame)
RETURN_ADDRESS_OFFSET)));
}
- cfun->machine->ra_need_lr = 1;
+ MACHINE_FUNCTION (*cfun)->ra_need_lr = 1;
return get_hard_reg_initial_val (Pmode, LR_REGNO);
}
@@ -18112,8 +18115,8 @@ rs6000_ra_ever_killed (void)
if (cfun->is_thunk)
return 0;
- if (cfun->machine->lr_save_state)
- return cfun->machine->lr_save_state - 1;
+ if (MACHINE_FUNCTION (*cfun)->lr_save_state)
+ return MACHINE_FUNCTION (*cfun)->lr_save_state - 1;
/* regs_ever_live has LR marked as used if any sibcalls are present,
but this should not force saving and restoring in the
@@ -18289,7 +18292,7 @@ rs6000_emit_eh_reg_restore (rtx source, rtx scratch)
state of lr_save_p so any change from here on would be a bug. In
particular, stop rs6000_ra_ever_killed from considering the SET
of lr we may have added just above. */
- cfun->machine->lr_save_state = info->lr_save_p + 1;
+ MACHINE_FUNCTION (*cfun)->lr_save_state = info->lr_save_p + 1;
}
static GTY(()) alias_set_type set = -1;
@@ -19041,7 +19044,7 @@ rs6000_savres_strategy (rs6000_stack_t *info, bool savep,
|| sibcall
|| crtl->calls_eh_return
|| !info->lr_save_p
- || cfun->machine->ra_need_lr
+ || MACHINE_FUNCTION (*cfun)->ra_need_lr
|| info->total_size > 32767);
savres_fprs_inline = (common
|| info->first_fp_reg_save == 64
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 169db26e30b..c0c73823b84 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -318,16 +318,17 @@ struct GTY(()) machine_function
bool has_landing_pad_p;
};
-/* Few accessor macros for struct cfun->machine->s390_frame_layout. */
+/* Few accessor macros for struct MACHINE_FUNCTION (*cfun)->s390_frame_layout.
+ */
-#define cfun_frame_layout (cfun->machine->frame_layout)
+#define cfun_frame_layout (MACHINE_FUNCTION (*cfun)->frame_layout)
#define cfun_save_high_fprs_p (!!cfun_frame_layout.high_fprs)
#define cfun_gprs_save_area_size ((cfun_frame_layout.last_save_gpr_slot - \
cfun_frame_layout.first_save_gpr_slot + 1) * UNITS_PER_LONG)
-#define cfun_set_fpr_bit(BITNUM) (cfun->machine->frame_layout.fpr_bitmap |= \
- (1 << (BITNUM)))
-#define cfun_fpr_bit_p(BITNUM) (!!(cfun->machine->frame_layout.fpr_bitmap & \
- (1 << (BITNUM))))
+#define cfun_set_fpr_bit(BITNUM) \
+ (MACHINE_FUNCTION (*cfun)->frame_layout.fpr_bitmap |= (1 << (BITNUM)))
+#define cfun_fpr_bit_p(BITNUM) \
+ (!!(MACHINE_FUNCTION (*cfun)->frame_layout.fpr_bitmap & (1 << (BITNUM))))
/* Number of GPRs and FPRs used for argument passing. */
#define GP_ARG_NUM_REG 5
@@ -390,7 +391,7 @@ s390_scalar_mode_supported_p (enum machine_mode mode)
void
s390_set_has_landing_pad_p (bool value)
{
- cfun->machine->has_landing_pad_p = value;
+ MACHINE_FUNCTION (*cfun)->has_landing_pad_p = value;
}
/* If two condition code modes are compatible, return a condition code
@@ -1896,7 +1897,7 @@ s390_decompose_address (rtx addr, struct s390_address *out)
pointer = base_ptr = true;
if ((reload_completed || reload_in_progress)
- && base == cfun->machine->base_reg)
+ && base == MACHINE_FUNCTION (*cfun)->base_reg)
pointer = base_ptr = literal_pool = true;
}
@@ -1944,7 +1945,7 @@ s390_decompose_address (rtx addr, struct s390_address *out)
pointer = indx_ptr = true;
if ((reload_completed || reload_in_progress)
- && indx == cfun->machine->base_reg)
+ && indx == MACHINE_FUNCTION (*cfun)->base_reg)
pointer = indx_ptr = literal_pool = true;
}
@@ -4915,7 +4916,7 @@ get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
if (GET_CODE (x) == SYMBOL_REF
&& tls_symbolic_operand (x) == TLS_MODEL_LOCAL_DYNAMIC)
{
- cfun->machine->some_ld_name = XSTR (x, 0);
+ MACHINE_FUNCTION (*cfun)->some_ld_name = XSTR (x, 0);
return 1;
}
@@ -4930,13 +4931,13 @@ get_some_local_dynamic_name (void)
{
rtx insn;
- if (cfun->machine->some_ld_name)
- return cfun->machine->some_ld_name;
+ if (MACHINE_FUNCTION (*cfun)->some_ld_name)
+ return MACHINE_FUNCTION (*cfun)->some_ld_name;
for (insn = get_insns (); insn ; insn = NEXT_INSN (insn))
if (INSN_P (insn)
&& for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0))
- return cfun->machine->some_ld_name;
+ return MACHINE_FUNCTION (*cfun)->some_ld_name;
gcc_unreachable ();
}
@@ -5454,7 +5455,7 @@ annotate_constant_pool_refs (rtx *x)
if (GET_CODE (memref) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (memref))
{
- rtx base = cfun->machine->base_reg;
+ rtx base = MACHINE_FUNCTION (*cfun)->base_reg;
rtx addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, memref, base),
UNSPEC_LTREF);
@@ -5470,7 +5471,7 @@ annotate_constant_pool_refs (rtx *x)
{
HOST_WIDE_INT off = INTVAL (XEXP (XEXP (memref, 0), 1));
rtx sym = XEXP (XEXP (memref, 0), 0);
- rtx base = cfun->machine->base_reg;
+ rtx base = MACHINE_FUNCTION (*cfun)->base_reg;
rtx addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, sym, base),
UNSPEC_LTREF);
@@ -5487,7 +5488,7 @@ annotate_constant_pool_refs (rtx *x)
if (GET_CODE (addrref) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (addrref))
{
- rtx base = cfun->machine->base_reg;
+ rtx base = MACHINE_FUNCTION (*cfun)->base_reg;
rtx addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, addrref, base),
UNSPEC_LTREF);
@@ -5503,7 +5504,7 @@ annotate_constant_pool_refs (rtx *x)
{
HOST_WIDE_INT off = INTVAL (XEXP (XEXP (addrref, 0), 1));
rtx sym = XEXP (XEXP (addrref, 0), 0);
- rtx base = cfun->machine->base_reg;
+ rtx base = MACHINE_FUNCTION (*cfun)->base_reg;
rtx addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, sym, base),
UNSPEC_LTREF);
@@ -5516,7 +5517,7 @@ annotate_constant_pool_refs (rtx *x)
if (GET_CODE (*x) == UNSPEC
&& XINT (*x, 1) == UNSPEC_LTREL_BASE)
{
- rtx base = cfun->machine->base_reg;
+ rtx base = MACHINE_FUNCTION (*cfun)->base_reg;
*x = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, XVECEXP (*x, 0, 0), base),
UNSPEC_LTREL_BASE);
return;
@@ -5609,9 +5610,11 @@ s390_split_branches (void)
INSN_ADDRESSES_NEW (tmp, -1);
annotate_constant_pool_refs (&PATTERN (tmp));
- target = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, XEXP (target, 0),
- cfun->machine->base_reg),
- UNSPEC_LTREL_BASE);
+ target
+ = gen_rtx_UNSPEC (Pmode,
+ gen_rtvec (2, XEXP (target, 0),
+ MACHINE_FUNCTION (*cfun)->base_reg),
+ UNSPEC_LTREL_BASE);
target = gen_rtx_PLUS (Pmode, temp_reg, target);
}
@@ -6245,14 +6248,14 @@ s390_mainpool_start (void)
static void
s390_mainpool_finish (struct constant_pool *pool)
{
- rtx base_reg = cfun->machine->base_reg;
+ rtx base_reg = MACHINE_FUNCTION (*cfun)->base_reg;
rtx insn;
/* If the pool is empty, we're done. */
if (pool->size == 0)
{
/* We don't actually need a base register after all. */
- cfun->machine->base_reg = NULL_RTX;
+ MACHINE_FUNCTION (*cfun)->base_reg = NULL_RTX;
if (pool->pool_insn)
remove_insn (pool->pool_insn);
@@ -6623,7 +6626,7 @@ s390_chunkify_start (void)
for (curr_pool = pool_list; curr_pool; curr_pool = curr_pool->next)
{
- rtx new_insn = gen_reload_base (cfun->machine->base_reg,
+ rtx new_insn = gen_reload_base (MACHINE_FUNCTION (*cfun)->base_reg,
curr_pool->label);
rtx insn = curr_pool->first_insn;
INSN_ADDRESSES_NEW (emit_insn_before (new_insn, insn), -1);
@@ -6638,7 +6641,7 @@ s390_chunkify_start (void)
struct constant_pool *pool = s390_find_pool (pool_list, insn);
if (pool)
{
- rtx new_insn = gen_reload_base (cfun->machine->base_reg,
+ rtx new_insn = gen_reload_base (MACHINE_FUNCTION (*cfun)->base_reg,
pool->label);
INSN_ADDRESSES_NEW (emit_insn_after (new_insn, insn), -1);
}
@@ -6931,10 +6934,10 @@ s390_regs_ever_clobbered (int *regs_ever_clobbered)
may use the eh registers, but the code which sets these registers is not
contained in that function. Hence s390_regs_ever_clobbered is not able to
deal with this automatically. */
- if (crtl->calls_eh_return || cfun->machine->has_landing_pad_p)
+ if (crtl->calls_eh_return || MACHINE_FUNCTION (*cfun)->has_landing_pad_p)
for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM ; i++)
if (crtl->calls_eh_return
- || (cfun->machine->has_landing_pad_p
+ || (MACHINE_FUNCTION (*cfun)->has_landing_pad_p
&& df_regs_ever_live_p (EH_RETURN_DATA_REGNO (i))))
regs_ever_clobbered[EH_RETURN_DATA_REGNO (i)] = 1;
@@ -7001,7 +7004,8 @@ s390_frame_area (int *area_bottom, int *area_top)
*area_top = t;
}
-/* Fill cfun->machine with info about register usage of current function.
+/* Fill MACHINE_FUNCTION (*cfun) with info about register usage of
+ current function.
Return in CLOBBERED_REGS which GPRs are currently considered set. */
static void
@@ -7039,13 +7043,13 @@ s390_register_info (int clobbered_regs[])
|= df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM);
clobbered_regs[BASE_REGNUM]
- |= (cfun->machine->base_reg
- && REGNO (cfun->machine->base_reg) == BASE_REGNUM);
+ |= (MACHINE_FUNCTION (*cfun)->base_reg
+ && REGNO (MACHINE_FUNCTION (*cfun)->base_reg) == BASE_REGNUM);
clobbered_regs[RETURN_REGNUM]
|= (!current_function_is_leaf
|| TARGET_TPF_PROFILING
- || cfun->machine->split_branches_pending_p
+ || MACHINE_FUNCTION (*cfun)->split_branches_pending_p
|| cfun_frame_layout.save_return_addr_p
|| crtl->calls_eh_return
|| cfun->stdarg);
@@ -7160,7 +7164,7 @@ s390_register_info (int clobbered_regs[])
cfun_set_fpr_bit (i);
}
-/* Fill cfun->machine with info about frame of current function. */
+/* Fill MACHINE_FUNCTION (*cfun) with info about frame of current function. */
static void
s390_frame_info (void)
@@ -7270,8 +7274,8 @@ s390_frame_info (void)
}
/* Generate frame layout. Fills in register and frame data for the current
- function in cfun->machine. This routine can be called multiple times;
- it will re-do the complete frame layout every time. */
+ function in MACHINE_FUNCTION (*cfun). This routine can be called multiple
+ times; it will re-do the complete frame layout every time. */
static void
s390_init_frame_layout (void)
@@ -7285,14 +7289,14 @@ s390_init_frame_layout (void)
choice but to assume we're going to need them until right at the
end of the machine dependent reorg phase. */
if (!TARGET_CPU_ZARCH)
- cfun->machine->split_branches_pending_p = true;
+ MACHINE_FUNCTION (*cfun)->split_branches_pending_p = true;
do
{
frame_size = cfun_frame_layout.frame_size;
/* Try to predict whether we'll need the base register. */
- base_used = cfun->machine->split_branches_pending_p
+ base_used = MACHINE_FUNCTION (*cfun)->split_branches_pending_p
|| crtl->uses_const_pool
|| (!DISP_IN_RANGE (frame_size)
&& !CONST_OK_FOR_K (frame_size));
@@ -7301,11 +7305,11 @@ s390_init_frame_layout (void)
leaf functions, try to use an unused call-clobbered register
as base register to avoid save/restore overhead. */
if (!base_used)
- cfun->machine->base_reg = NULL_RTX;
+ MACHINE_FUNCTION (*cfun)->base_reg = NULL_RTX;
else if (current_function_is_leaf && !df_regs_ever_live_p (5))
- cfun->machine->base_reg = gen_rtx_REG (Pmode, 5);
+ MACHINE_FUNCTION (*cfun)->base_reg = gen_rtx_REG (Pmode, 5);
else
- cfun->machine->base_reg = gen_rtx_REG (Pmode, BASE_REGNUM);
+ MACHINE_FUNCTION (*cfun)->base_reg = gen_rtx_REG (Pmode, BASE_REGNUM);
s390_register_info (clobbered_regs);
s390_frame_info ();
@@ -7332,8 +7336,8 @@ s390_update_frame_layout (void)
df_set_regs_ever_live (STACK_POINTER_REGNUM,
clobbered_regs[STACK_POINTER_REGNUM] ? true : false);
- if (cfun->machine->base_reg)
- df_set_regs_ever_live (REGNO (cfun->machine->base_reg), true);
+ if (MACHINE_FUNCTION (*cfun)->base_reg)
+ df_set_regs_ever_live (REGNO (MACHINE_FUNCTION (*cfun)->base_reg), true);
}
/* Return true if it is legal to put a value with MODE into REGNO. */
@@ -7391,9 +7395,9 @@ s390_hard_regno_rename_ok (unsigned int old_reg, unsigned int new_reg)
{
/* Once we've decided upon a register to use as base register, it must
no longer be used for any other purpose. */
- if (cfun->machine->base_reg)
- if (REGNO (cfun->machine->base_reg) == old_reg
- || REGNO (cfun->machine->base_reg) == new_reg)
+ if (MACHINE_FUNCTION (*cfun)->base_reg)
+ if (REGNO (MACHINE_FUNCTION (*cfun)->base_reg) == old_reg
+ || REGNO (MACHINE_FUNCTION (*cfun)->base_reg) == new_reg)
return false;
return true;
@@ -7438,7 +7442,7 @@ s390_can_eliminate (const int from, const int to)
if (TARGET_CPU_ZARCH)
{
s390_init_frame_layout ();
- return cfun->machine->base_reg == NULL_RTX;
+ return MACHINE_FUNCTION (*cfun)->base_reg == NULL_RTX;
}
return false;
@@ -7786,8 +7790,8 @@ s390_emit_prologue (void)
/* Dummy insn to mark literal pool slot. */
- if (cfun->machine->base_reg)
- emit_insn (gen_main_pool (cfun->machine->base_reg));
+ if (MACHINE_FUNCTION (*cfun)->base_reg)
+ emit_insn (gen_main_pool (MACHINE_FUNCTION (*cfun)->base_reg));
offset = cfun_frame_layout.f0_offset;
@@ -10150,7 +10154,7 @@ s390_reorg (void)
s390_mainpool_finish (pool);
/* We're done splitting branches. */
- cfun->machine->split_branches_pending_p = false;
+ MACHINE_FUNCTION (*cfun)->split_branches_pending_p = false;
break;
}
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index ab0b63b8dd7..1b9e87070c4 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -332,8 +332,9 @@ struct GTY(()) machine_function
bool prologue_data_valid_p;
};
-#define sparc_leaf_function_p cfun->machine->leaf_function_p
-#define sparc_prologue_data_valid_p cfun->machine->prologue_data_valid_p
+#define sparc_leaf_function_p MACHINE_FUNCTION (*cfun)->leaf_function_p
+#define sparc_prologue_data_valid_p \
+ MACHINE_FUNCTION (*cfun)->prologue_data_valid_p
/* Register we pretend to think the frame pointer is allocated to.
Normally, this is %fp, but if we are in a leaf procedure, this
@@ -9043,13 +9044,13 @@ get_some_local_dynamic_name (void)
{
rtx insn;
- if (cfun->machine->some_ld_name)
- return cfun->machine->some_ld_name;
+ if (MACHINE_FUNCTION (*cfun)->some_ld_name)
+ return MACHINE_FUNCTION (*cfun)->some_ld_name;
for (insn = get_insns (); insn ; insn = NEXT_INSN (insn))
if (INSN_P (insn)
&& for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0))
- return cfun->machine->some_ld_name;
+ return MACHINE_FUNCTION (*cfun)->some_ld_name;
gcc_unreachable ();
}
@@ -9063,7 +9064,7 @@ get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED)
&& GET_CODE (x) == SYMBOL_REF
&& SYMBOL_REF_TLS_MODEL (x) == TLS_MODEL_LOCAL_DYNAMIC)
{
- cfun->machine->some_ld_name = XSTR (x, 0);
+ MACHINE_FUNCTION (*cfun)->some_ld_name = XSTR (x, 0);
return 1;
}
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index fc5872d0e1e..c8b293ea3d1 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -1056,11 +1056,11 @@ xtensa_copy_incoming_a7 (rtx opnd)
rtx reg, tmp;
enum machine_mode mode;
- if (!cfun->machine->need_a7_copy)
+ if (!MACHINE_FUNCTION (*cfun)->need_a7_copy)
return opnd;
/* This function should never be called again once a7 has been copied. */
- gcc_assert (!cfun->machine->set_frame_ptr_insn);
+ gcc_assert (!MACHINE_FUNCTION (*cfun)->set_frame_ptr_insn);
mode = GET_MODE (opnd);
@@ -1080,7 +1080,7 @@ xtensa_copy_incoming_a7 (rtx opnd)
/* 1-word args will always be in a7; 2-word args in a6/a7. */
gcc_assert (REGNO (reg) + HARD_REGNO_NREGS (A7_REG, mode) - 1 == A7_REG);
- cfun->machine->need_a7_copy = false;
+ MACHINE_FUNCTION (*cfun)->need_a7_copy = false;
/* Copy a7 to a new pseudo at the function entry. Use gen_raw_REG to
create the REG for a7 so that hard_frame_pointer_rtx is not used. */
@@ -1115,7 +1115,8 @@ xtensa_copy_incoming_a7 (rtx opnd)
gcc_unreachable ();
}
- cfun->machine->set_frame_ptr_insn = emit_insn (gen_set_frame_ptr ());
+ MACHINE_FUNCTION (*cfun)->set_frame_ptr_insn
+ = emit_insn (gen_set_frame_ptr ());
/* For DF and DI mode arguments, copy the incoming value in A6 now. */
if (mode == DFmode || mode == DImode)
@@ -1124,13 +1125,13 @@ xtensa_copy_incoming_a7 (rtx opnd)
entry_insns = get_insns ();
end_sequence ();
- if (cfun->machine->vararg_a7)
+ if (MACHINE_FUNCTION (*cfun)->vararg_a7)
{
/* This is called from within builtin_saveregs, which will insert the
saveregs code at the function entry, ahead of anything placed at
the function entry now. Instead, save the sequence to be inserted
at the beginning of the saveregs code. */
- cfun->machine->vararg_a7_copy = entry_insns;
+ MACHINE_FUNCTION (*cfun)->vararg_a7_copy = entry_insns;
}
else
{
@@ -1546,7 +1547,7 @@ void
xtensa_setup_frame_addresses (void)
{
/* Set flag to cause TARGET_FRAME_POINTER_REQUIRED to return true. */
- cfun->machine->accesses_prev_frame = 1;
+ MACHINE_FUNCTION (*cfun)->accesses_prev_frame = 1;
emit_library_call
(gen_rtx_SYMBOL_REF (Pmode, "__xtensa_libgcc_window_spill"),
@@ -2036,7 +2037,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
regno = regbase + *arg_words;
if (cum->incoming && regno <= A7_REG && regno + words > A7_REG)
- cfun->machine->need_a7_copy = true;
+ MACHINE_FUNCTION (*cfun)->need_a7_copy = true;
return gen_rtx_REG (mode, regno);
}
@@ -2516,7 +2517,7 @@ xtensa_frame_pointer_required (void)
This seems wrong but maybe it's necessary for other architectures.
This function is derived from the i386 code. */
- if (cfun->machine->accesses_prev_frame)
+ if (MACHINE_FUNCTION (*cfun)->accesses_prev_frame)
return true;
return false;
@@ -2551,7 +2552,7 @@ xtensa_expand_prologue (void)
if (frame_pointer_needed)
{
- if (cfun->machine->set_frame_ptr_insn)
+ if (MACHINE_FUNCTION (*cfun)->set_frame_ptr_insn)
{
rtx first;
@@ -2562,7 +2563,7 @@ xtensa_expand_prologue (void)
/* For all instructions prior to set_frame_ptr_insn, replace
hard_frame_pointer references with stack_pointer. */
for (insn = first;
- insn != cfun->machine->set_frame_ptr_insn;
+ insn != MACHINE_FUNCTION (*cfun)->set_frame_ptr_insn;
insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
@@ -2711,14 +2712,14 @@ xtensa_builtin_saveregs (void)
set_mem_alias_set (gp_regs, get_varargs_alias_set ());
/* Now store the incoming registers. */
- cfun->machine->need_a7_copy = true;
- cfun->machine->vararg_a7 = true;
+ MACHINE_FUNCTION (*cfun)->need_a7_copy = true;
+ MACHINE_FUNCTION (*cfun)->vararg_a7 = true;
move_block_from_reg (GP_ARG_FIRST + arg_words,
adjust_address (gp_regs, BLKmode,
arg_words * UNITS_PER_WORD),
gp_left);
- gcc_assert (cfun->machine->vararg_a7_copy != 0);
- emit_insn_before (cfun->machine->vararg_a7_copy, get_insns ());
+ gcc_assert (MACHINE_FUNCTION (*cfun)->vararg_a7_copy != 0);
+ emit_insn_before (MACHINE_FUNCTION (*cfun)->vararg_a7_copy, get_insns ());
return XEXP (gp_regs, 0);
}
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 87329e019d8..a41434f079c 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -859,7 +859,8 @@ when another one comes along.
GCC defines a data structure called @code{struct function} which
contains all of the data specific to an individual function. This
-structure contains a field called @code{machine} whose type is
+structure contains a field which can be accessed as
+@code{MACHINE_FUNCTION (@var{function})} whose type is
@code{struct machine_function *}, which can be used by targets to point
to their own specific data.
diff --git a/gcc/function.c b/gcc/function.c
index f6c572c7b15..ab66c84057f 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -217,7 +217,7 @@ free_after_compilation (struct function *f)
memset (crtl, 0, sizeof (struct rtl_data));
f->eh = NULL;
- f->machine = NULL;
+ MACHINE_FUNCTION (*f) = NULL;
f->cfg = NULL;
regno_reg_rtx = NULL;
@@ -4201,7 +4201,7 @@ allocate_struct_function (tree fndecl, bool abstract_p)
init_eh_for_function ();
if (init_machine_status)
- cfun->machine = (*init_machine_status) ();
+ MACHINE_FUNCTION (*cfun) = (*init_machine_status) ();
#ifdef OVERRIDE_ABI_FORMAT
OVERRIDE_ABI_FORMAT (fndecl);
diff --git a/gcc/function.h b/gcc/function.h
index 5c15f4a503e..ac4541edf4c 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -1,6 +1,6 @@
/* Structure for saving state for a nested function.
Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
@@ -218,6 +218,7 @@ struct GTY(()) incoming_args {
};
#define INCOMING_ARGS_INFO(INCOMING_ARGS) ((INCOMING_ARGS).info._ca)
+#define MACHINE_FUNCTION(FUNCTION) ((FUNCTION).machine._mf)
/* Data for function partitioning. */
struct GTY(()) function_subsections {
@@ -512,7 +513,7 @@ struct GTY(()) function {
/* For md files. */
/* tm.h can use this to store whatever it likes. */
- struct machine_function * GTY ((maybe_undef)) machine;
+ machine_function_u GTY ((desc ("%0.target_arch"))) machine;
/* Language-specific code can use this to store whatever it likes. */
struct language_function * language;