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
c7cf3a9b
Commit
c7cf3a9b
authored
Aug 15, 2019
by
Aldy Hernandez
Committed by
Aldy Hernandez
Aug 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enforce canonicalization in value_range.
From-SVN: r274525
parent
eb2211e3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
7 deletions
+41
-7
gcc/ChangeLog
+34
-0
gcc/tree-vrp.c
+0
-0
gcc/tree-vrp.h
+4
-4
gcc/vr-values.c
+3
-3
No files found.
gcc/ChangeLog
View file @
c7cf3a9b
2019-08-15 Aldy Hernandez <aldyh@redhat.com>
* tree-vrp.c (value_range_base::set): Merge in code from
value_range_base::set_and_canonicalize.
Enforce canonicalization at set time.
Normalize [MIN, MAX] into VARYING and ~[MIN, MAX] into UNDEFINED.
(value_range_base::set_undefined): Inline call to set().
(value_range_base::set_varying): Same.
(value_range_base::singleton_p): Handle VR_ANTI_RANGEs.
(vrp_val_max): New argument handle_pointers.
(vrp_val_min): Same.
(ranges_from_anti_range): Same.
(extract_range_into_wide_ints): Use tree argument instead of sign
and precision.
(extract_range_from_multiplicative_op): Take in tree type instead
of precision and sign. Adapt function for canonicalized ranges.
(extract_range_from_binary_expr): Pass type to
extract_range_from_multiplicative_op.
Adapt for canonicalized ranges.
(extract_range_from_unary_expr): Same.
(value_range_base::intersect_helper): Adjust for canonicalized
ranges.
(value_range_base::union_helper): Same.
(value_range_base::normalize_symbolics): New.
* tree-vrp.h (class value_range_base): Remove
set_and_canonicalize.
New prototype for normalize_symbolics.
(class value_range): Remove set_and_canonicalize.
(vrp_val_min): Adjust prototype.
(vrp_val_max): Same.
* vr-values.c
(vr_values::extract_range_for_var_from_comparison_expr): Call set
instead of set_and_canonicalize.
2019-08-15 Richard Sandiford <richard.sandiford@arm.com>
PR middle-end/91444
...
...
gcc/tree-vrp.c
View file @
c7cf3a9b
This diff is collapsed.
Click to expand it.
gcc/tree-vrp.h
View file @
c7cf3a9b
...
...
@@ -71,12 +71,13 @@ public:
/* Misc methods. */
tree
type
()
const
;
bool
may_contain_p
(
tree
)
const
;
void
set_and_canonicalize
(
enum
value_range_kind
,
tree
,
tree
);
bool
zero_p
()
const
;
bool
nonzero_p
()
const
;
bool
singleton_p
(
tree
*
result
=
NULL
)
const
;
void
dump
(
FILE
*
)
const
;
value_range_base
normalize_symbolics
()
const
;
protected
:
void
check
();
static
value_range_base
union_helper
(
const
value_range_base
*
,
...
...
@@ -143,7 +144,6 @@ class GTY((user)) value_range : public value_range_base
/* Misc methods. */
void
deep_copy
(
const
value_range
*
);
void
set_and_canonicalize
(
enum
value_range_kind
,
tree
,
tree
,
bitmap
=
NULL
);
void
dump
(
FILE
*
)
const
;
private
:
...
...
@@ -270,8 +270,8 @@ extern int operand_less_p (tree, tree);
extern
bool
vrp_val_is_min
(
const_tree
);
extern
bool
vrp_val_is_max
(
const_tree
);
extern
tree
vrp_val_min
(
const_tree
);
extern
tree
vrp_val_max
(
const_tree
);
extern
tree
vrp_val_min
(
const_tree
,
bool
handle_pointers
=
false
);
extern
tree
vrp_val_max
(
const_tree
,
bool
handle_pointers
=
false
);
extern
void
extract_range_from_unary_expr
(
value_range_base
*
vr
,
enum
tree_code
code
,
...
...
gcc/vr-values.c
View file @
c7cf3a9b
...
...
@@ -522,9 +522,9 @@ vr_values::extract_range_for_var_from_comparison_expr (tree var,
vice-versa. Use set_and_canonicalize which does this for
us. */
if
(
cond_code
==
LE_EXPR
)
vr_p
->
set
_and_canonicalize
(
VR_RANGE
,
min
,
max
,
vr_p
->
equiv
());
vr_p
->
set
(
VR_RANGE
,
min
,
max
,
vr_p
->
equiv
());
else
if
(
cond_code
==
GT_EXPR
)
vr_p
->
set
_and_canonicalize
(
VR_ANTI_RANGE
,
min
,
max
,
vr_p
->
equiv
());
vr_p
->
set
(
VR_ANTI_RANGE
,
min
,
max
,
vr_p
->
equiv
());
else
gcc_unreachable
();
}
...
...
@@ -596,7 +596,7 @@ vr_values::extract_range_for_var_from_comparison_expr (tree var,
&&
vrp_val_is_max
(
max
))
min
=
max
=
limit
;
vr_p
->
set
_and_canonicalize
(
VR_ANTI_RANGE
,
min
,
max
,
vr_p
->
equiv
());
vr_p
->
set
(
VR_ANTI_RANGE
,
min
,
max
,
vr_p
->
equiv
());
}
else
if
(
cond_code
==
LE_EXPR
||
cond_code
==
LT_EXPR
)
{
...
...
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