aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-09-22 20:55:21 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-09-22 20:55:21 +0200
commit2dc589be3cb487eda8f537c535cab0f5a9a4a6a1 (patch)
treee20eb730d1aa94bba5c78eaacfb5b7e5fd413900 /gcc/testsuite
parentc90df0d293367452d193f04a18c2233d64a10d1a (diff)
downloadgcc-2dc589be3cb487eda8f537c535cab0f5a9a4a6a1.zip
gcc-2dc589be3cb487eda8f537c535cab0f5a9a4a6a1.tar.gz
gcc-2dc589be3cb487eda8f537c535cab0f5a9a4a6a1.tar.bz2
re PR sanitizer/81929 (exponential slowdown in undefined behavior sanitizer for streaming)
PR sanitizer/81929 * tree.c (struct replace_placeholders_t): Add pset field. (replace_placeholders_r): Call cp_walk_tree with d->pset as last argument instead of NULL. Formatting fix. (replace_placeholders): Add pset variable, add its address into data. Pass &pset instead of NULL to cp_walk_tree. * g++.dg/ubsan/pr81929.C: New test. From-SVN: r253106
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/ubsan/pr81929.C14
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 54723c2..7c51045 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-09-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/81929
+ * g++.dg/ubsan/pr81929.C: New test.
+
2017-09-22 Richard Sandiford <richard.sandiford@linaro.org>
PR tree-optimization/82289
diff --git a/gcc/testsuite/g++.dg/ubsan/pr81929.C b/gcc/testsuite/g++.dg/ubsan/pr81929.C
new file mode 100644
index 0000000..90f2628
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ubsan/pr81929.C
@@ -0,0 +1,14 @@
+// PR sanitizer/81929
+// { dg-do compile }
+// { dg-options "-std=c++14 -fsanitize=undefined" }
+
+struct S { S &operator<< (long); S foo (); S (); };
+
+void
+bar ()
+{
+ static_cast<S&>(S () << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0
+ << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0
+ << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0
+ << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0 << 0).foo ();
+}