+2017-03-22 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2016-06-13 Martin Liska <mliska@suse.cz>
+
+ PR target/65705
+ PR target/69804
+ PR sanitizer/71458
+
+ * toplev.c (process_options): Enable MPX with LSAN and UBSAN.
+ * tree-chkp.c (chkp_walk_pointer_assignments): Verify that
+ FIELD != NULL.
+
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
+2017-03-22 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2016-06-13 Martin Liska <mliska@suse.cz>
+
+ PR sanitizer/71458
+ * gcc.target/i386/pr71458.c: New test.
+
2017-03-22 Martin Liska <mliska@suse.cz>
Backport from mainline
--- /dev/null
+/* { dg-do compile { target { ! x32 } } } */
+/* { dg-options "-fcheck-pointer-bounds -mmpx -fsanitize=bounds" } */
+/* { dg-error "'-fcheck-pointer-bounds' is not supported with '-fsanitize=bounds'" "" { target *-*-* } 0 } */
+
+enum {} a[0];
+void fn1(int);
+void fn2() { fn1(a[-1]); }
{
if (targetm.chkp_bound_mode () == VOIDmode)
{
- error ("-fcheck-pointer-bounds is not supported for this target");
+ error ("%<-fcheck-pointer-bounds%> is not supported for this "
+ "target");
flag_check_pointer_bounds = 0;
}
+ if (flag_sanitize & SANITIZE_BOUNDS)
+ {
+ error ("%<-fcheck-pointer-bounds%> is not supported with "
+ "%<-fsanitize=bounds%>");
+ flag_check_pointer_bounds = 0;
+ }
+
if (flag_sanitize & SANITIZE_ADDRESS)
{
- error ("-fcheck-pointer-bounds is not supported with "
+ error ("%<-fcheck-pointer-bounds%> is not supported with "
"Address Sanitizer");
flag_check_pointer_bounds = 0;
}
+
+ if (flag_sanitize & SANITIZE_THREAD)
+ {
+ error (UNKNOWN_LOCATION,
+ "%<-fcheck-pointer-bounds%> is not supported with "
+ "Thread Sanitizer");
+
+ flag_check_pointer_bounds = 0;
+ }
}
/* One region RA really helps to decrease the code size. */
FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (rhs), cnt, field, val)
{
- if (chkp_type_has_pointer (TREE_TYPE (field)))
+ if (field && chkp_type_has_pointer (TREE_TYPE (field)))
{
tree lhs_field = chkp_build_component_ref (lhs, field);
chkp_walk_pointer_assignments (lhs_field, val, arg, handler);