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
7a17c588
Commit
7a17c588
authored
Jul 18, 1994
by
Jim Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(find_reg): Store divide results in temporary variables.
From-SVN: r7778
parent
8c4f5c09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
19 deletions
+27
-19
gcc/global.c
+27
-19
No files found.
gcc/global.c
View file @
7a17c588
...
...
@@ -1096,28 +1096,36 @@ find_reg (allocno, losers, alt_regs_p, accept_call_clobbered, retrying)
if
(
local_reg_n_refs
[
regno
]
!=
0
/* Don't use a reg no good for this pseudo. */
&&
!
TEST_HARD_REG_BIT
(
used2
,
regno
)
&&
HARD_REGNO_MODE_OK
(
regno
,
mode
)
&&
(((
double
)
local_reg_n_refs
[
regno
]
/
local_reg_live_length
[
regno
])
<
((
double
)
allocno_n_refs
[
allocno
]
/
allocno_live_length
[
allocno
])))
&&
HARD_REGNO_MODE_OK
(
regno
,
mode
))
{
/* Hard reg REGNO was used less in total by local regs
than it would be used by this one allocno! */
int
k
;
for
(
k
=
0
;
k
<
max_regno
;
k
++
)
if
(
reg_renumber
[
k
]
>=
0
)
{
int
r
=
reg_renumber
[
k
];
int
endregno
=
r
+
HARD_REGNO_NREGS
(
r
,
PSEUDO_REGNO_MODE
(
k
));
/* We explicitly evaluate the divide results into temporary
variables so as to avoid excess precision problems that occur
on a i386-unknown-sysv4.2 (unixware) host. */
double
tmp1
=
((
double
)
local_reg_n_refs
[
regno
]
/
local_reg_live_length
[
regno
]);
double
tmp2
=
((
double
)
allocno_n_refs
[
allocno
]
/
allocno_live_length
[
allocno
]);
if
(
tmp1
<
tmp2
)
{
/* Hard reg REGNO was used less in total by local regs
than it would be used by this one allocno! */
int
k
;
for
(
k
=
0
;
k
<
max_regno
;
k
++
)
if
(
reg_renumber
[
k
]
>=
0
)
{
int
r
=
reg_renumber
[
k
];
int
endregno
=
r
+
HARD_REGNO_NREGS
(
r
,
PSEUDO_REGNO_MODE
(
k
));
if
(
regno
>=
r
&&
regno
<
endregno
)
reg_renumber
[
k
]
=
-
1
;
}
if
(
regno
>=
r
&&
regno
<
endregno
)
reg_renumber
[
k
]
=
-
1
;
}
best_reg
=
regno
;
break
;
best_reg
=
regno
;
break
;
}
}
}
}
...
...
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