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
2f96b754
Commit
2f96b754
authored
19 years ago
by
Eric Botcazou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move around a couple of hunks and add a missing one for commit 111866
From-SVN: r112046
parent
17237f6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
30 deletions
+28
-30
gcc/fold-const.c
+28
-30
No files found.
gcc/fold-const.c
View file @
2f96b754
...
...
@@ -3724,32 +3724,6 @@ range_binop (enum tree_code code, tree type, tree arg0, int upper0_p,
return
constant_boolean_node
(
result
,
type
);
}
/* Return the predecessor of VAL in its type, handling the infinite case. */
static
tree
range_predecessor
(
tree
val
)
{
tree
type
=
TREE_TYPE
(
val
);
if
(
INTEGRAL_TYPE_P
(
type
)
&&
val
==
TYPE_MIN_VALUE
(
type
))
return
0
;
else
return
range_binop
(
MINUS_EXPR
,
NULL_TREE
,
val
,
0
,
integer_one_node
,
0
);
}
/* Return the successor of VAL in its type, handling the infinite case. */
static
tree
range_successor
(
tree
val
)
{
tree
type
=
TREE_TYPE
(
val
);
if
(
INTEGRAL_TYPE_P
(
type
)
&&
val
==
TYPE_MAX_VALUE
(
type
))
return
0
;
else
return
range_binop
(
PLUS_EXPR
,
NULL_TREE
,
val
,
0
,
integer_one_node
,
0
);
}
/* Given EXP, a logical expression, set the range it is testing into
variables denoted by PIN_P, PLOW, and PHIGH. Return the expression
actually being tested. *PLOW and *PHIGH will be made of the same type
...
...
@@ -4174,6 +4148,32 @@ build_range_check (tree type, tree exp, int in_p, tree low, tree high)
return
0
;
}
/* Return the predecessor of VAL in its type, handling the infinite case. */
static
tree
range_predecessor
(
tree
val
)
{
tree
type
=
TREE_TYPE
(
val
);
if
(
INTEGRAL_TYPE_P
(
type
)
&&
val
==
TYPE_MIN_VALUE
(
type
))
return
0
;
else
return
range_binop
(
MINUS_EXPR
,
NULL_TREE
,
val
,
0
,
integer_one_node
,
0
);
}
/* Return the successor of VAL in its type, handling the infinite case. */
static
tree
range_successor
(
tree
val
)
{
tree
type
=
TREE_TYPE
(
val
);
if
(
INTEGRAL_TYPE_P
(
type
)
&&
val
==
TYPE_MAX_VALUE
(
type
))
return
0
;
else
return
range_binop
(
PLUS_EXPR
,
NULL_TREE
,
val
,
0
,
integer_one_node
,
0
);
}
/* Given two ranges, see if we can merge them into one. Return 1 if we
can, 0 if we can't. Set the output range into the specified parameters. */
...
...
@@ -4348,10 +4348,8 @@ merge_ranges (int *pin_p, tree *plow, tree *phigh, int in0_p, tree low0,
return + [x + 1, y - 1]. */
if
(
low0
==
0
&&
high1
==
0
)
{
low
=
range_binop
(
PLUS_EXPR
,
NULL_TREE
,
high0
,
1
,
integer_one_node
,
1
);
high
=
range_binop
(
MINUS_EXPR
,
NULL_TREE
,
low1
,
0
,
integer_one_node
,
0
);
low
=
range_successor
(
high0
);
high
=
range_predecessor
(
low1
);
if
(
low
==
0
||
high
==
0
)
return
0
;
...
...
This diff is collapsed.
Click to expand it.
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