+2013-11-29 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/59331
+ * decl.c (compute_array_index_type): Don't build COMPOUND_EXPR for
+ instrumentation.
+
2013-11-28 Jakub Jelinek <jakub@redhat.com>
PR c++/59297
LE_EXPR rather than LT_EXPR. */
tree t = fold_build2 (PLUS_EXPR, TREE_TYPE (itype), itype,
build_one_cst (TREE_TYPE (itype)));
- t = fold_build2 (COMPOUND_EXPR, TREE_TYPE (t),
- ubsan_instrument_vla (input_location, t), t);
+ t = ubsan_instrument_vla (input_location, t);
finish_expr_stmt (t);
}
}
+2013-11-29 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/59331
+ * g++.dg/ubsan/pr59331.C: New test.
+ * g++.dg/ubsan/cxx1y-vla.C: Enable -Wall -Wno-unused-variable.
+ Disable the -w option.
+ * c-c++-common/ubsan/vla-1.c: Likewise.
+ * c-c++-common/ubsan/vla-2.c: Likewise.
+ * c-c++-common/ubsan/vla-3.c: Don't use the -w option.
+
2013-11-29 Joseph Myers <joseph@codesourcery.com>
PR c/42262
/* { dg-do run } */
-/* { dg-options "-fsanitize=vla-bound -w" } */
+/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable" } */
static int
bar (void)
/* { dg-do run } */
-/* { dg-options "-fsanitize=vla-bound -w" } */
+/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable" } */
int
main (void)
/* { dg-do run } */
-/* { dg-options "-fsanitize=vla-bound -w" } */
+/* { dg-options "-fsanitize=vla-bound" } */
/* Don't instrument the arrays here. */
int
/* { dg-do run } */
-/* { dg-options "-fsanitize=vla-bound -w -std=c++1y" } */
+/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable -std=c++1y" } */
/* { dg-shouldfail "ubsan" } */
int
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=vla-bound -Wall -Wno-unused-variable" } */
+
+void foo(int i)
+{
+ /* Don't warn here with "value computed is not used". */
+ char a[i];
+}