Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
a2e11fd9
Commit
a2e11fd9
authored
Jan 09, 2001
by
Nick Clifton
Committed by
Nick Clifton
Jan 09, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SWitch use if {save|restore}_machine_status with {init|free}_machine_status
From-SVN: r38836
parent
4ba478b8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
36 deletions
+65
-36
gcc/ChangeLog
+23
-0
gcc/config/d30v/d30v.c
+31
-35
gcc/config/d30v/d30v.h
+10
-0
gcc/config/d30v/d30v.md
+1
-1
No files found.
gcc/ChangeLog
View file @
a2e11fd9
2001-01-09 Nick Clifton <nickc@redhat.com>
* config/rs6000/rs6000.c (rs6000_sysv_varargs_p): Delete.
(setup_incoming_varargs): Use sysv_varargs_p field of the
cfun->machine structure.
(struct machine_function): Move to rs6000.h
(rs6000_save_machine_status): Delete.
(rs6000_restore_machine_status): Delete.
(rs6000_init_machine_status): New Function.
(rs6000_free_machine_status): New Function.
(rs6000_init_expanders): Use new functions.
* config/rs6000/rs6000.h (rs6000_sysv_varargs_p): Delete
export.
(struct machine_function): Move here.
* config/rs6000/sysv4.h (RS6000_VARARGS_AREA): Use
sysv_varargs_p field of the cfun->machine structure.
* config/rs6000/rs6000-protos.h (rs6000_save_machine_status):
Remove prototype.
(rs6000_restore_machine_status): Remove prototype.
2001-01-09 Richard Henderson <rth@redhat.com>
* sched-int.h (struct deps): Add max_reg, reg_last_in_use; merge
...
...
gcc/config/d30v/d30v.c
View file @
a2e11fd9
...
...
@@ -52,16 +52,9 @@ static void d30v_add_gc_roots PARAMS ((void));
struct
rtx_def
*
d30v_compare_op0
;
struct
rtx_def
*
d30v_compare_op1
;
/* Define the information needed to modify the epilogue for EH. */
rtx
d30v_eh_epilogue_sp_ofs
;
/* Cached value of d30v_stack_info */
static
d30v_stack_t
*
d30v_stack_cache
=
(
d30v_stack_t
*
)
0
;
/* Cache for __builtin_return_addr */
static
rtx
d30v_return_addr_rtx
;
/* Values of the -mbranch-cost=n string. */
int
d30v_branch_cost
=
D30V_DEFAULT_BRANCH_COST
;
const
char
*
d30v_branch_cost_string
=
(
const
char
*
)
0
;
...
...
@@ -2594,7 +2587,7 @@ d30v_expand_epilogue ()
for
(
i
=
GPR_FIRST
;
i
<=
GPR_LAST
;
i
++
)
if
(
info
->
save_p
[
i
]
==
1
)
{
if
(
d30v_
eh_epilogue_sp_ofs
&&
i
==
GPR_LINK
)
if
(
cfun
->
machine
->
eh_epilogue_sp_ofs
&&
i
==
GPR_LINK
)
extra_stack
=
4
;
else
{
...
...
@@ -2615,15 +2608,15 @@ d30v_expand_epilogue ()
if
(
extra_stack
)
{
if
(
d30v_
eh_epilogue_sp_ofs
)
emit_insn
(
gen_addsi3
(
d30v_
eh_epilogue_sp_ofs
,
d30v_
eh_epilogue_sp_ofs
,
if
(
cfun
->
machine
->
eh_epilogue_sp_ofs
)
emit_insn
(
gen_addsi3
(
cfun
->
machine
->
eh_epilogue_sp_ofs
,
cfun
->
machine
->
eh_epilogue_sp_ofs
,
GEN_INT
(
extra_stack
)));
else
emit_insn
(
gen_addsi3
(
sp
,
sp
,
GEN_INT
(
extra_stack
)));
}
if
(
d30v_
eh_epilogue_sp_ofs
)
emit_insn
(
gen_addsi3
(
sp
,
sp
,
d30v_
eh_epilogue_sp_ofs
));
if
(
cfun
->
machine
->
eh_epilogue_sp_ofs
)
emit_insn
(
gen_addsi3
(
sp
,
sp
,
cfun
->
machine
->
eh_epilogue_sp_ofs
));
/* Now emit the return instruction. */
emit_jump_insn
(
gen_rtx_RETURN
(
VOIDmode
));
...
...
@@ -3595,34 +3588,39 @@ d30v_adjust_cost (insn, link, dep_insn, cost)
}
/* Functions to save and restore d30v_return_addr_rtx. */
struct
machine_function
{
rtx
ra_rtx
;
};
/* Routine to allocate, mark and free a per-function,
machine specific structure. */
static
void
d30v_
save
_machine_status
(
p
)
d30v_
init
_machine_status
(
p
)
struct
function
*
p
;
{
struct
machine_function
*
machine
=
p
->
machine
=
(
struct
machine_function
*
)
xmalloc
(
sizeof
(
struct
machine_function
));
}
p
->
machine
=
machine
;
machine
->
ra_rtx
=
d30v_return_addr_rtx
;
static
void
d30v_mark_machine_status
(
p
)
struct
function
*
p
;
{
if
(
p
->
machine
==
NULL
)
return
;
ggc_mark_rtx
(
p
->
machine
->
ra_rtx
);
ggc_mark_rtx
(
p
->
machine
->
eh_epilogue_sp_ofs
);
}
static
void
d30v_
restor
e_machine_status
(
p
)
d30v_
fre
e_machine_status
(
p
)
struct
function
*
p
;
{
struct
machine_function
*
machine
=
p
->
machine
;
d30v_return_addr_rtx
=
machine
->
ra_rtx
;
if
(
machine
==
NULL
)
return
;
free
(
machine
);
p
->
machine
=
(
struct
machine_function
*
)
0
;
p
->
machine
=
NULL
;
}
/* Do anything needed before RTL is emitted for each function. */
...
...
@@ -3630,12 +3628,10 @@ d30v_restore_machine_status (p)
void
d30v_init_expanders
()
{
d30v_return_addr_rtx
=
NULL_RTX
;
d30v_eh_epilogue_sp_ofs
=
NULL_RTX
;
/* Arrange to save and restore machine status around nested functions. */
save_machine_status
=
d30v_save_machine_status
;
restore_machine_status
=
d30v_restore_machine_status
;
init_machine_status
=
d30v_init_machine_status
;
mark_machine_status
=
d30v_mark_machine_status
;
free_machine_status
=
d30v_free_machine_status
;
}
/* Find the current function's return address.
...
...
@@ -3650,11 +3646,13 @@ d30v_return_addr ()
{
rtx
ret
;
if
((
ret
=
d30v_return_addr_rtx
)
==
NULL
)
ret
=
cfun
->
machine
->
ra_rtx
;
if
(
ret
==
NULL
)
{
rtx
init
;
d30v_return_addr
_rtx
=
ret
=
gen_reg_rtx
(
Pmode
);
cfun
->
machine
->
ra
_rtx
=
ret
=
gen_reg_rtx
(
Pmode
);
init
=
gen_rtx
(
SET
,
VOIDmode
,
ret
,
gen_rtx
(
REG
,
Pmode
,
GPR_LINK
));
push_topmost_sequence
();
...
...
@@ -3673,6 +3671,4 @@ d30v_add_gc_roots ()
{
ggc_add_rtx_root
(
&
d30v_compare_op0
,
1
);
ggc_add_rtx_root
(
&
d30v_compare_op1
,
1
);
ggc_add_rtx_root
(
&
d30v_eh_epilogue_sp_ofs
,
1
);
ggc_add_rtx_root
(
&
d30v_return_addr_rtx
,
1
);
}
gcc/config/d30v/d30v.h
View file @
a2e11fd9
...
...
@@ -2870,6 +2870,16 @@ typedef int CUMULATIVE_ARGS;
varargs. */
/* #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) */
/* A C structure for machine-specific, per-function data.
This is added to the cfun structure. */
typedef
struct
machine_function
{
/* Additionsl stack adjustment in __builtin_eh_throw. */
struct
rtx_def
*
eh_epilogue_sp_ofs
;
/* Records __builtin_return address. */
struct
rtx_def
*
ra_rtx
;
}
machine_function
;
/* Generating Code for Profiling. */
...
...
gcc/config/d30v/d30v.md
View file @
a2e11fd9
...
...
@@ -2971,7 +2971,7 @@
""
"
{
d30v_
eh_epilogue_sp_ofs = operands
[
1
]
;
cfun->machine->
eh_epilogue_sp_ofs = operands
[
1
]
;
if (GET_CODE (operands
[
2
]
) != REG || REGNO (operands
[
2
]
) != GPR_LINK)
{
rtx ra = gen_rtx_REG (Pmode, GPR_LINK);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment