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
a55e9d2b
Commit
a55e9d2b
authored
Jul 28, 1995
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(reg_unused_after): New function.
From-SVN: r10183
parent
aa630177
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
gcc/config/sh/sh.c
+50
-0
No files found.
gcc/config/sh/sh.c
View file @
a55e9d2b
...
...
@@ -1850,3 +1850,53 @@ sh_function_arg_partial_nregs (cum, mode, type, named)
}
return
0
;
}
/* Return non-zero if REG is not used after INSN.
We assume REG is a reload reg, and therefore does
not live past labels or calls or jumps. */
int
reg_unused_after
(
reg
,
insn
)
rtx
reg
;
rtx
insn
;
{
enum
rtx_code
code
,
prev_code
=
UNKNOWN
;
rtx
set
;
/* If the reg is set by this instruction, then it is safe for our
case. Disregard the case where this is a store to memory, since
we are checking a register used in the store address. */
set
=
single_set
(
insn
);
if
(
set
&&
GET_CODE
(
SET_DEST
(
set
))
!=
MEM
&&
reg_overlap_mentioned_p
(
reg
,
SET_DEST
(
set
)))
return
1
;
while
(
insn
=
NEXT_INSN
(
insn
))
{
if
(
prev_code
==
CALL_INSN
&&
call_used_regs
[
REGNO
(
reg
)])
return
1
;
code
=
GET_CODE
(
insn
);
if
(
GET_CODE
(
insn
)
==
CODE_LABEL
)
return
1
;
if
(
code
==
INSN
&&
GET_CODE
(
PATTERN
(
insn
))
==
SEQUENCE
)
{
insn
=
XVECEXP
(
PATTERN
(
insn
),
0
,
0
);
code
=
GET_CODE
(
insn
);
}
if
(
GET_RTX_CLASS
(
code
)
==
'i'
)
{
rtx
set
=
single_set
(
insn
);
if
(
set
&&
reg_overlap_mentioned_p
(
reg
,
SET_SRC
(
set
)))
return
0
;
if
(
set
&&
reg_overlap_mentioned_p
(
reg
,
SET_DEST
(
set
)))
return
GET_CODE
(
SET_DEST
(
set
))
!=
MEM
;
if
(
set
==
0
&&
reg_overlap_mentioned_p
(
reg
,
PATTERN
(
insn
)))
return
0
;
}
prev_code
=
code
;
}
return
1
;
}
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