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
ae431183
Commit
ae431183
authored
Dec 13, 1994
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(expand_expr, case MINUS_EXPR): Properly handle case when the NEGATE
overflows. From-SVN: r8648
parent
cd8ce14b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
gcc/expr.c
+23
-4
No files found.
gcc/expr.c
View file @
ae431183
...
...
@@ -5239,10 +5239,29 @@ expand_expr (exp, target, tmode, modifier)
/* Convert A - const to A + (-const). */
if
(
TREE_CODE
(
TREE_OPERAND
(
exp
,
1
))
==
INTEGER_CST
)
{
exp
=
build
(
PLUS_EXPR
,
type
,
TREE_OPERAND
(
exp
,
0
),
fold
(
build1
(
NEGATE_EXPR
,
type
,
TREE_OPERAND
(
exp
,
1
))));
goto
plus_expr
;
tree
negated
=
fold
(
build1
(
NEGATE_EXPR
,
type
,
TREE_OPERAND
(
exp
,
1
)));
/* Deal with the case where we can't negate the constant
in TYPE. */
if
(
TREE_UNSIGNED
(
type
)
||
TREE_OVERFLOW
(
negated
))
{
tree
newtype
=
signed_type
(
type
);
tree
newop0
=
convert
(
newtype
,
TREE_OPERAND
(
exp
,
0
));
tree
newop1
=
convert
(
newtype
,
TREE_OPERAND
(
exp
,
1
));
tree
newneg
=
fold
(
build1
(
NEGATE_EXPR
,
newtype
,
newop1
));
if
(
!
TREE_OVERFLOW
(
newneg
))
return
expand_expr
(
convert
(
type
,
build
(
PLUS_EXPR
,
newtype
,
newop0
,
newneg
)),
target
,
tmode
,
modifier
);
}
else
{
exp
=
build
(
PLUS_EXPR
,
type
,
TREE_OPERAND
(
exp
,
0
),
negated
);
goto
plus_expr
;
}
}
this_optab
=
sub_optab
;
goto
binop
;
...
...
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