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
ea87523e
Commit
ea87523e
authored
Dec 23, 1993
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(expand_expr, case MINUS_EXPR): When expanding an initializer, use
plus_constant as appropriate. From-SVN: r6283
parent
5d49bd0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
+14
-1
gcc/expr.c
+14
-1
No files found.
gcc/expr.c
View file @
ea87523e
...
...
@@ -4870,6 +4870,9 @@ expand_expr (exp, target, tmode, modifier)
return
temp
?
temp
:
gen_rtx
(
PLUS
,
mode
,
op0
,
op1
);
case
MINUS_EXPR
:
/* For initializers, we are allowed to return a MINUS of two
symbolic constants. Here we handle all cases when both operands
are constant. */
/* Handle difference of two symbolic constants,
for the sake of an initializer. */
if
((
modifier
==
EXPAND_SUM
||
modifier
==
EXPAND_INITIALIZER
)
...
...
@@ -4880,7 +4883,17 @@ expand_expr (exp, target, tmode, modifier)
VOIDmode
,
modifier
);
rtx
op1
=
expand_expr
(
TREE_OPERAND
(
exp
,
1
),
NULL_RTX
,
VOIDmode
,
modifier
);
return
gen_rtx
(
MINUS
,
mode
,
op0
,
op1
);
/* If one operand is a CONST_INT, put it last. */
if
(
GET_CODE
(
op0
)
==
CONST_INT
)
temp
=
op0
,
op0
=
op1
,
op1
=
temp
;
/* If the last operand is a CONST_INT, use plus_constant of
the negated constant. Else make the MINUS. */
if
(
GET_CODE
(
op1
)
==
CONST_INT
)
return
plus_constant
(
op0
,
-
INTVAL
(
op1
));
else
return
gen_rtx
(
MINUS
,
mode
,
op0
,
op1
);
}
/* Convert A - const to A + (-const). */
if
(
TREE_CODE
(
TREE_OPERAND
(
exp
,
1
))
==
INTEGER_CST
)
...
...
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