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
a97f5a86
Commit
a97f5a86
authored
Sep 23, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(expand_increment): Don't store directly ito a subreg
that is narrower than a word. From-SVN: r5433
parent
672fd7e2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
gcc/expr.c
+12
-2
No files found.
gcc/expr.c
View file @
a97f5a86
...
...
@@ -7648,6 +7648,10 @@ expand_increment (exp, post)
enum
machine_mode
mode
=
TYPE_MODE
(
TREE_TYPE
(
exp
));
int
op0_is_copy
=
0
;
int
single_insn
=
0
;
/* 1 means we can't store into OP0 directly,
because it is a subreg narrower than a word,
and we don't dare clobber the rest of the word. */
int
bad_subreg
=
0
;
if
(
output_bytecode
)
{
...
...
@@ -7688,6 +7692,9 @@ expand_increment (exp, post)
if
(
GET_CODE
(
op0
)
==
SUBREG
&&
SUBREG_PROMOTED_VAR_P
(
op0
))
SUBREG_REG
(
op0
)
=
copy_to_reg
(
SUBREG_REG
(
op0
));
else
if
(
GET_CODE
(
op0
)
==
SUBREG
&&
GET_MODE_BITSIZE
(
GET_MODE
(
op0
))
<
BITS_PER_WORD
)
bad_subreg
=
1
;
op0_is_copy
=
((
GET_CODE
(
op0
)
==
SUBREG
||
GET_CODE
(
op0
)
==
REG
)
&&
temp
!=
get_last_insn
());
...
...
@@ -7723,8 +7730,11 @@ expand_increment (exp, post)
then we cannot just increment OP0. We must therefore contrive to
increment the original value. Then, for postincrement, we can return
OP0 since it is a copy of the old value. For preincrement, expand here
unless we can do it with a single insn. */
if
(
op0_is_copy
||
(
!
post
&&
!
single_insn
))
unless we can do it with a single insn.
Likewise if storing directly into OP0 would clobber high bits
we need to preserve (bad_subreg). */
if
(
op0_is_copy
||
(
!
post
&&
!
single_insn
)
||
bad_subreg
)
{
/* This is the easiest way to increment the value wherever it is.
Problems with multiple evaluation of INCREMENTED are prevented
...
...
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