PR sanitizer/82353
* g++.dg/ubsan/pr82353-2.C: New test.
* g++.dg/ubsan/pr82353-2-aux.cc: New file.
* g++.dg/ubsan/pr82353-2.h: New file.
From-SVN: r253744
+2017-10-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/82353
+ * g++.dg/ubsan/pr82353-2.C: New test.
+ * g++.dg/ubsan/pr82353-2-aux.cc: New file.
+ * g++.dg/ubsan/pr82353-2.h: New file.
+
2017-10-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/81048
--- /dev/null
+// PR sanitizer/82353
+
+#include "pr82353-2.h"
+
+B a;
+E b;
+B C::c0;
+unsigned D::d0;
+
+void
+foo ()
+{
+ a.b1 = p.f2.e2.b1 = 5;
+}
+
+void
+bar ()
+{
+ int c = p.f2.e4.d1.a0 - -~p.f4 * 89;
+ q.c0.b0 = i > g * a.b0 * h - k % a.b1;
+ if ((~(m * j) && -~p.f4 * 90284000534361) % ~m * j)
+ b.e2.b0 << l << f;
+ o = -~p.f4 * 89;
+ int d = p.f4;
+ if (b.e2.b0)
+ b.e2.b1 = c;
+ bool e = ~-~p.f4;
+ a.b1 % e;
+ if (k / p.f2.e2.b1)
+ b.e4.d0 = g * a.b0 * h;
+ n = j;
+}
--- /dev/null
+// PR sanitizer/82353
+// { dg-do run }
+// { dg-options "-fsanitize=undefined -fno-sanitize-recover=undefined -std=c++11 -O2 -w" }
+// { dg-additional-sources "pr82353-2-aux.cc" }
+
+#include "pr82353-2.h"
+
+unsigned long f, g;
+bool h, k, j, i;
+unsigned char l, m;
+short n;
+unsigned o;
+F p;
+
+int
+main ()
+{
+ foo ();
+ bar ();
+}
--- /dev/null
+extern unsigned long f, g;
+extern bool h, i, j, k;
+extern unsigned char l, m;
+extern short n;
+extern unsigned o;
+struct B {
+ short b0 : 27;
+ long b1 : 10;
+};
+struct A {
+ int a0 : 5;
+};
+struct C {
+ static B c0;
+};
+struct D {
+ static unsigned d0;
+ A d1;
+};
+struct E {
+ B e2;
+ D e4;
+};
+struct F {
+ E f2;
+ short f4;
+};
+extern F p;
+extern C q;
+void foo ();
+void bar ();