+2015-09-04 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/67279
+ * c-typeck.c (build_binary_op): Don't instrument static initializers.
+
2015-09-03 Martin Sebor <msebor@redhat.com>
PR c/66516
if ((flag_sanitize & (SANITIZE_SHIFT | SANITIZE_DIVIDE
| SANITIZE_FLOAT_DIVIDE))
&& do_ubsan_in_current_function ()
- && (doing_div_or_mod || doing_shift))
+ && (doing_div_or_mod || doing_shift)
+ && !require_constant_value)
{
/* OP0 and/or OP1 might have side-effects. */
op0 = c_save_expr (op0);
+2015-09-04 Marek Polacek <polacek@redhat.com>
+
+ PR sanitizer/67279
+ * gcc.dg/ubsan/pr67279.c: New test.
+
2015-09-04 Andrey Turetskiy <andrey.turetskiy@intel.com>
Petr Murzin <petr.murzin@intel.com>
Kirill Yukhin <kirill.yukhin@intel.com>
--- /dev/null
+/* PR sanitizer/67279 */
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=undefined -w" } */
+
+#define INT_MIN (-__INT_MAX__ - 1)
+
+void
+foo (void)
+{
+ static int a1 = 1 << 31;
+ static int a2 = 10 << 30;
+ static int a3 = 100 << 28;
+ static int a4 = INT_MIN / -1;
+}