+2017-03-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/80168
+ * asan.c (instrument_derefs): Copy over last operand from
+ original COMPONENT_REF to the new COMPONENT_REF with
+ DECL_BIT_FIELD_REPRESENTATIVE.
+ * ubsan.c (instrument_object_size): Likewise.
+
2017-03-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/80170
tree repr = DECL_BIT_FIELD_REPRESENTATIVE (TREE_OPERAND (t, 1));
instrument_derefs (iter, build3 (COMPONENT_REF, TREE_TYPE (repr),
TREE_OPERAND (t, 0), repr,
- NULL_TREE), location, is_store);
+ TREE_OPERAND (t, 2)),
+ location, is_store);
return;
}
+2017-03-27 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/80168
+ * gcc.dg/asan/pr80168.c: New test.
+
2017-03-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/80170
--- /dev/null
+/* PR sanitizer/80168 */
+/* { dg-do compile } */
+
+int a;
+
+int
+foo (void)
+{
+ struct S { int c[a]; int q : 8; int e : 4; } f;
+ f.e = 4;
+ return f.e;
+}
{
tree repr = DECL_BIT_FIELD_REPRESENTATIVE (TREE_OPERAND (t, 1));
t = build3 (COMPONENT_REF, TREE_TYPE (repr), TREE_OPERAND (t, 0),
- repr, NULL_TREE);
+ repr, TREE_OPERAND (t, 2));
}
break;
case ARRAY_REF: