public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aldyh/heads/ranger-staging)] Minor fixes for wrestrict conversion.
@ 2020-10-06 9:42 Aldy Hernandez
0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2020-10-06 9:42 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:c98b2f13935d7402ab5b6a51a826977801ffa5e3
commit c98b2f13935d7402ab5b6a51a826977801ffa5e3
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Tue Oct 6 09:16:03 2020 +0200
Minor fixes for wrestrict conversion.
Diff:
---
gcc/calls.c | 7 +++++--
gcc/gimple-ssa-warn-restrict.c | 1 +
gcc/testsuite/gcc.dg/Wrestrict-22.c | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/gcc/calls.c b/gcc/calls.c
index c9c71657e54..701c182268a 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1279,8 +1279,11 @@ get_size_range (range_query *query, tree exp, gimple *stmt, tree range[2],
|| TREE_CODE (exp) == INTEGER_CST);
gcc_assert (query->range_of_expr (vr, exp, stmt));
range_type = vr.kind ();
- min = wi::to_wide (vr.min ());
- max = wi::to_wide (vr.max ());
+ if (!vr.undefined_p ())
+ {
+ min = wi::to_wide (vr.min ());
+ max = wi::to_wide (vr.max ());
+ }
}
else
range_type = determine_value_range (exp, &min, &max);
diff --git a/gcc/gimple-ssa-warn-restrict.c b/gcc/gimple-ssa-warn-restrict.c
index 7961c51c5b0..c700714eb79 100644
--- a/gcc/gimple-ssa-warn-restrict.c
+++ b/gcc/gimple-ssa-warn-restrict.c
@@ -149,6 +149,7 @@ public:
tree offset_out_of_bounds (int, offset_int[3]) const;
private:
+ /* Call statement to the built-in. */
gimple *stmt;
range_query *query;
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-22.c b/gcc/testsuite/gcc.dg/Wrestrict-22.c
index 798d399db3c..46f507b56b6 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-22.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-22.c
@@ -5,5 +5,5 @@ void test_memcpy_warn (char *d, unsigned n)
{
for (unsigned i = n; i < 30; ++i)
if (i > 10)
- __builtin_memcpy (d, d + 2, i); /* { dg-warning "overlaps between" } */
+ __builtin_memcpy (d, d + 2, i); /* { dg-warning "overlaps" } */
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-06 9:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 9:42 [gcc(refs/users/aldyh/heads/ranger-staging)] Minor fixes for wrestrict conversion Aldy Hernandez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).