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
c7c9468a
Commit
c7c9468a
authored
Jan 07, 2018
by
Jeff Law
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit right version
From-SVN: r256321
parent
11ef0b22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
18 deletions
+45
-18
gcc/gimple-ssa-warn-restrict.c
+45
-18
No files found.
gcc/gimple-ssa-warn-restrict.c
View file @
c7c9468a
...
@@ -698,9 +698,10 @@ builtin_access::builtin_access (gcall *call, builtin_memref &dst,
...
@@ -698,9 +698,10 @@ builtin_access::builtin_access (gcall *call, builtin_memref &dst,
/* For string functions, adjust the size range of the source
/* For string functions, adjust the size range of the source
reference by the inverse boundaries of the offset (because
reference by the inverse boundaries of the offset (because
the higher
the offset into the string the shorter its
the higher the offset into the string the shorter its
length). */
length). */
if
(
srcref
->
offrange
[
1
]
<
srcref
->
sizrange
[
0
])
if
(
srcref
->
offrange
[
1
]
>=
0
&&
srcref
->
offrange
[
1
]
<
srcref
->
sizrange
[
0
])
srcref
->
sizrange
[
0
]
-=
srcref
->
offrange
[
1
];
srcref
->
sizrange
[
0
]
-=
srcref
->
offrange
[
1
];
else
else
srcref
->
sizrange
[
0
]
=
0
;
srcref
->
sizrange
[
0
]
=
0
;
...
@@ -1134,30 +1135,53 @@ builtin_access::overlap ()
...
@@ -1134,30 +1135,53 @@ builtin_access::overlap ()
if
(
!
dstref
->
base
||
!
srcref
->
base
)
if
(
!
dstref
->
base
||
!
srcref
->
base
)
return
false
;
return
false
;
/* If the base object is an array adjust the lower bound of the offset
/* Set the access offsets. */
to be non-negative. */
acs
.
dstoff
[
0
]
=
dstref
->
offrange
[
0
];
acs
.
dstoff
[
1
]
=
dstref
->
offrange
[
1
];
/* If the base object is an array adjust the bounds of the offset
to be non-negative and within the bounds of the array if possible. */
if
(
dstref
->
base
if
(
dstref
->
base
&&
TREE_CODE
(
TREE_TYPE
(
dstref
->
base
))
==
ARRAY_TYPE
)
&&
TREE_CODE
(
TREE_TYPE
(
dstref
->
base
))
==
ARRAY_TYPE
)
acs
.
dstoff
[
0
]
=
wi
::
smax
(
dstref
->
offrange
[
0
],
0
);
{
else
if
(
acs
.
dstoff
[
0
]
<
0
&&
acs
.
dstoff
[
1
]
>=
0
)
acs
.
dstoff
[
0
]
=
dstref
->
offrange
[
0
]
;
acs
.
dstoff
[
0
]
=
0
;
acs
.
dstoff
[
1
]
=
dstref
->
offrange
[
1
];
if
(
acs
.
dstoff
[
1
]
<
acs
.
dstoff
[
0
])
{
if
(
tree
size
=
TYPE_SIZE_UNIT
(
TREE_TYPE
(
dstref
->
base
)))
acs
.
dstoff
[
1
]
=
wi
::
umin
(
acs
.
dstoff
[
1
],
wi
::
to_offset
(
size
));
else
acs
.
dstoff
[
1
]
=
wi
::
umin
(
acs
.
dstoff
[
1
],
maxobjsize
);
}
}
acs
.
srcoff
[
0
]
=
srcref
->
offrange
[
0
];
acs
.
srcoff
[
1
]
=
srcref
->
offrange
[
1
];
if
(
srcref
->
base
if
(
srcref
->
base
&&
TREE_CODE
(
TREE_TYPE
(
srcref
->
base
))
==
ARRAY_TYPE
)
&&
TREE_CODE
(
TREE_TYPE
(
srcref
->
base
))
==
ARRAY_TYPE
)
acs
.
srcoff
[
0
]
=
wi
::
smax
(
srcref
->
offrange
[
0
],
0
);
{
else
if
(
acs
.
srcoff
[
0
]
<
0
&&
acs
.
srcoff
[
1
]
>=
0
)
acs
.
srcoff
[
0
]
=
srcref
->
offrange
[
0
]
;
acs
.
srcoff
[
0
]
=
0
;
acs
.
srcoff
[
1
]
=
srcref
->
offrange
[
1
];
if
(
tree
size
=
TYPE_SIZE_UNIT
(
TREE_TYPE
(
srcref
->
base
)))
acs
.
srcoff
[
1
]
=
wi
::
umin
(
acs
.
srcoff
[
1
],
wi
::
to_offset
(
size
));
else
if
(
acs
.
srcoff
[
1
]
<
acs
.
srcoff
[
0
])
acs
.
srcoff
[
1
]
=
wi
::
umin
(
acs
.
srcoff
[
1
],
maxobjsize
);
}
/* When the lower bound of the offset is less that the upper bound
/* When the upper bound of the offset is less than the lower bound
disregard it and use the inverse of the maximum object size
the former is the result of a negative offset being represented
instead. The upper bound is the result of a negative offset
as a large positive value or vice versa. The resulting range is
being represented as a large positive value. */
a union of two subranges: [MIN, UB] and [LB, MAX]. Since such
a union is not representable using the current data structure
replace it with the full range of offsets. */
if
(
acs
.
dstoff
[
1
]
<
acs
.
dstoff
[
0
])
if
(
acs
.
dstoff
[
1
]
<
acs
.
dstoff
[
0
])
acs
.
dstoff
[
0
]
=
-
maxobjsize
;
{
acs
.
dstoff
[
0
]
=
-
maxobjsize
-
1
;
acs
.
dstoff
[
1
]
=
maxobjsize
;
}
/* Validate the offset and size of each reference on its own first.
/* Validate the offset and size of each reference on its own first.
This is independent of whether or not the base objects are the
This is independent of whether or not the base objects are the
...
@@ -1173,7 +1197,10 @@ builtin_access::overlap ()
...
@@ -1173,7 +1197,10 @@ builtin_access::overlap ()
/* Repeat the same as above but for the source offsets. */
/* Repeat the same as above but for the source offsets. */
if
(
acs
.
srcoff
[
1
]
<
acs
.
srcoff
[
0
])
if
(
acs
.
srcoff
[
1
]
<
acs
.
srcoff
[
0
])
acs
.
srcoff
[
0
]
=
-
maxobjsize
;
{
acs
.
srcoff
[
0
]
=
-
maxobjsize
-
1
;
acs
.
srcoff
[
1
]
=
maxobjsize
;
}
maxoff
=
acs
.
srcoff
[
0
]
+
srcref
->
sizrange
[
0
];
maxoff
=
acs
.
srcoff
[
0
]
+
srcref
->
sizrange
[
0
];
if
(
maxobjsize
<
maxoff
)
if
(
maxobjsize
<
maxoff
)
...
...
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