* fold-const.c (tree_single_nonzero_warnv_p): For TARGET_EXPR, use
TARGET_EXPR_SLOT as a base.
* g++.dg/ubsan/null-7.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@235958
138bc75d-0d04-0410-961f-
82ee72b054a4
+2016-05-06 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2016-04-29 Marek Polacek <polacek@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/70342
+ * fold-const.c (tree_single_nonzero_warnv_p): For TARGET_EXPR, use
+ TARGET_EXPR_SLOT as a base.
+
2016-05-04 Eric Botcazou <ebotcazou@adacore.com>
* tree-ssa-coalesce.c (gimple_can_coalesce_p): Fix reference in head
if (!DECL_P (base))
base = get_base_address (base);
+ if (base && TREE_CODE (base) == TARGET_EXPR)
+ base = TARGET_EXPR_SLOT (base);
+
if (!base)
return false;
+2016-05-06 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2016-04-29 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/70342
+ * g++.dg/ubsan/null-7.C: New test.
+
2016-05-03 Pierre-Marie de Rodat <derodat@adacore.com>
* gnat.dg/debug5.adb: New testcase.
--- /dev/null
+// PR sanitizer/70342
+// { dg-do compile }
+// { dg-options "-fsanitize=null" }
+
+class A {};
+class B {
+public:
+ B(A);
+};
+class C {
+public:
+ C operator<<(B);
+};
+class D {
+ D(const int &);
+ C m_blackList;
+};
+D::D(const int &) {
+ m_blackList << A() << A() << A() << A() << A() << A() << A() << A() << A()
+ << A() << A() << A() << A() << A() << A() << A() << A() << A()
+ << A() << A() << A() << A() << A() << A() << A() << A() << A()
+ << A() << A() << A() << A() << A() << A() << A() << A() << A()
+ << A() << A() << A() << A() << A() << A() << A() << A() << A();
+}