+2018-02-12 Paolo Bonzini <bonzini@gnu.org>
+
+ PR sanitizer/84307
+ * internal-fn.def (ASAN_CHECK): Fix fnspec to account for return value.
+ (ASAN_MARK): Fix fnspec to account for return value, change pointer
+ argument from 'R' to 'W' so that the pointed-to datum is clobbered.
+
2018-02-08 Jan Hubicka <hubicka@ucw.cz>
PR middle-end/83665
DEF_INTERNAL_FN (UBSAN_OBJECT_SIZE, ECF_LEAF | ECF_NOTHROW, NULL)
DEF_INTERNAL_FN (ABNORMAL_DISPATCHER, ECF_NORETURN, NULL)
DEF_INTERNAL_FN (BUILTIN_EXPECT, ECF_CONST | ECF_LEAF | ECF_NOTHROW, NULL)
-DEF_INTERNAL_FN (ASAN_CHECK, ECF_TM_PURE | ECF_LEAF | ECF_NOTHROW, ".R...")
-DEF_INTERNAL_FN (ASAN_MARK, ECF_LEAF | ECF_NOTHROW, ".R..")
+DEF_INTERNAL_FN (ASAN_CHECK, ECF_TM_PURE | ECF_LEAF | ECF_NOTHROW, "..R..")
+DEF_INTERNAL_FN (ASAN_MARK, ECF_LEAF | ECF_NOTHROW, "..W.")
DEF_INTERNAL_FN (ASAN_POISON, ECF_LEAF | ECF_NOTHROW | ECF_NOVOPS, NULL)
DEF_INTERNAL_FN (ASAN_POISON_USE, ECF_LEAF | ECF_NOTHROW | ECF_NOVOPS, NULL)
DEF_INTERNAL_FN (ADD_OVERFLOW, ECF_CONST | ECF_LEAF | ECF_NOTHROW, NULL)
+2018-02-12 Paolo Bonzini <bonzini@gnu.org>
+
+ PR sanitizer/84307
+ * gcc.dg/asan/pr84307.c: New test.
+
2018-02-12 Nathan Sidwell <nathan@acm.org>
* g++.dg/parse/pr84263.C: New.
--- /dev/null
+/* PR middle-end/83185 */
+/* { dg-do link } */
+/* { dg-options "-O1" } */
+
+struct f {
+ void (*func)(void);
+};
+
+extern void link_error(void);
+extern int printf(const char *f, ...);
+
+static inline struct f *gimme_null(struct f *result)
+{
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ struct f *x = gimme_null(&(struct f) { .func = link_error });
+ printf("%p", x);
+}