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
dede82f2
Commit
dede82f2
authored
Oct 14, 2019
by
Aldy Hernandez
Committed by
Aldy Hernandez
Oct 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Normalize unsigned ~[0,0] into [1,MAX].
From-SVN: r276949
parent
103197a1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
15 deletions
+34
-15
gcc/ChangeLog
+7
-0
gcc/testsuite/ChangeLog
+5
-0
gcc/testsuite/gcc.dg/tree-ssa/evrp4.c
+1
-1
gcc/tree-vrp.c
+4
-4
gcc/tree-vrp.h
+17
-10
No files found.
gcc/ChangeLog
View file @
dede82f2
2019-10-14 Aldy Hernandez <aldyh@redhat.com>
* tree-vrp.c (value_range_base::set): Normalize unsigned ~[0,0]
into [1,MAX].
* tree-vrp.h (value_range_base::nonzero_p): Adjust for unsigned
non-zero being represented as [1,MAX].
2019-10-14 Xiong Hu Luo <luoxhu@linux.ibm.com>
2019-10-14 Xiong Hu Luo <luoxhu@linux.ibm.com>
* tree-sra.c (dump_access): Add missing braces.
* tree-sra.c (dump_access): Add missing braces.
...
...
gcc/testsuite/ChangeLog
View file @
dede82f2
2019-10-14 Aldy Hernandez <aldyh@redhat.com>
* gcc.dg/tree-ssa/evrp4.c: Adjust for unsigned non-zero being
[1,MAX].
2019-10-13 Iain Sandoe <iain@sandoe.co.uk>
2019-10-13 Iain Sandoe <iain@sandoe.co.uk>
* gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in
* gcc.target/i386/indirect-thunk-1.c: Allow 'l' or 'L' in
...
...
gcc/testsuite/gcc.dg/tree-ssa/evrp4.c
View file @
dede82f2
...
@@ -17,4 +17,4 @@ int bar (struct st *s)
...
@@ -17,4 +17,4 @@ int bar (struct st *s)
foo
(
&
s
->
a
);
foo
(
&
s
->
a
);
}
}
/* { dg-final { scan-tree-dump "\
~\\\[0B, 0
B\\\]" "evrp" } } */
/* { dg-final { scan-tree-dump "\
\\[1B, -1
B\\\]" "evrp" } } */
gcc/tree-vrp.c
View file @
dede82f2
...
@@ -800,13 +800,13 @@ value_range_base::set (enum value_range_kind kind, tree min, tree max)
...
@@ -800,13 +800,13 @@ value_range_base::set (enum value_range_kind kind, tree min, tree max)
kind
=
VR_RANGE
;
kind
=
VR_RANGE
;
}
}
else
if
(
is_min
else
if
(
is_min
/* A
s a special exception preserve non-null ranges
. */
/* A
llow non-zero pointers to be normalized to [1,MAX]
. */
&&
!
(
TYPE_UNSIGNED
(
TREE_TYPE
(
min
))
||
(
POINTER_TYPE_P
(
TREE_TYPE
(
min
))
&&
integer_zerop
(
max
)))
&&
integer_zerop
(
min
)))
{
{
tree
one
=
build_int_cst
(
TREE_TYPE
(
max
),
1
);
tree
one
=
build_int_cst
(
TREE_TYPE
(
max
),
1
);
min
=
int_const_binop
(
PLUS_EXPR
,
max
,
one
);
min
=
int_const_binop
(
PLUS_EXPR
,
max
,
one
);
max
=
vrp_val_max
(
TREE_TYPE
(
max
));
max
=
vrp_val_max
(
TREE_TYPE
(
max
)
,
true
);
kind
=
VR_RANGE
;
kind
=
VR_RANGE
;
}
}
else
if
(
is_max
)
else
if
(
is_max
)
...
...
gcc/tree-vrp.h
View file @
dede82f2
...
@@ -245,16 +245,6 @@ value_range_base::zero_p () const
...
@@ -245,16 +245,6 @@ value_range_base::zero_p () const
&&
integer_zerop
(
m_max
));
&&
integer_zerop
(
m_max
));
}
}
/* Return TRUE if range is nonzero. */
inline
bool
value_range_base
::
nonzero_p
()
const
{
return
(
m_kind
==
VR_ANTI_RANGE
&&
integer_zerop
(
m_min
)
&&
integer_zerop
(
m_max
));
}
extern
void
dump_value_range
(
FILE
*
,
const
value_range
*
);
extern
void
dump_value_range
(
FILE
*
,
const
value_range
*
);
extern
void
dump_value_range
(
FILE
*
,
const
value_range_base
*
);
extern
void
dump_value_range
(
FILE
*
,
const
value_range_base
*
);
...
@@ -322,6 +312,23 @@ extern tree get_single_symbol (tree, bool *, tree *);
...
@@ -322,6 +312,23 @@ extern tree get_single_symbol (tree, bool *, tree *);
extern
void
maybe_set_nonzero_bits
(
edge
,
tree
);
extern
void
maybe_set_nonzero_bits
(
edge
,
tree
);
extern
value_range_kind
determine_value_range
(
tree
,
wide_int
*
,
wide_int
*
);
extern
value_range_kind
determine_value_range
(
tree
,
wide_int
*
,
wide_int
*
);
/* Return TRUE if range is nonzero. */
inline
bool
value_range_base
::
nonzero_p
()
const
{
if
(
m_kind
==
VR_ANTI_RANGE
&&
!
TYPE_UNSIGNED
(
type
())
&&
integer_zerop
(
m_min
)
&&
integer_zerop
(
m_max
))
return
true
;
return
(
m_kind
==
VR_RANGE
&&
TYPE_UNSIGNED
(
type
())
&&
integer_onep
(
m_min
)
&&
vrp_val_is_max
(
m_max
,
true
));
}
/* Return TRUE if *VR includes the value zero. */
/* Return TRUE if *VR includes the value zero. */
inline
bool
inline
bool
...
...
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